summaryrefslogtreecommitdiff
path: root/sys/amd64
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2020-10-10 21:52:00 +0000
committerConrad Meyer <cem@FreeBSD.org>2020-10-10 21:52:00 +0000
commitf8e8a06d23a11bce26d67607d84dad2dd3e6c0f0 (patch)
treef64dd0b028128986eb53dcd7230c8d63015e38f9 /sys/amd64
parent10b1a17594a27f83c3ddbce44814f15a0b6bab91 (diff)
downloadsrc-test-f8e8a06d23a11bce26d67607d84dad2dd3e6c0f0.tar.gz
src-test-f8e8a06d23a11bce26d67607d84dad2dd3e6c0f0.zip
random(4) FenestrasX: Push root seed version to arc4random(3)
Push the root seed version to userspace through the VDSO page, if the RANDOM_FENESTRASX algorithm is enabled. Otherwise, there is no functional change. The mechanism can be disabled with debug.fxrng_vdso_enable=0. arc4random(3) obtains a pointer to the root seed version published by the kernel in the shared page at allocation time. Like arc4random(9), it maintains its own per-process copy of the seed version corresponding to the root seed version at the time it last rekeyed. On read requests, the process seed version is compared with the version published in the shared page; if they do not match, arc4random(3) reseeds from the kernel before providing generated output. This change does not implement the FenestrasX concept of PCPU userspace generators seeded from a per-process base generator. That change is left for future discussion/work. Reviewed by: kib (previous version) Approved by: csprng (me -- only touching FXRNG here) Differential Revision: https://reviews.freebsd.org/D22839
Notes
Notes: svn path=/head/; revision=366622
Diffstat (limited to 'sys/amd64')
-rw-r--r--sys/amd64/amd64/elf_machdep.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/elf_machdep.c b/sys/amd64/amd64/elf_machdep.c
index 0aea4a0d355ba..a3fb1184bb05f 100644
--- a/sys/amd64/amd64/elf_machdep.c
+++ b/sys/amd64/amd64/elf_machdep.c
@@ -72,7 +72,7 @@ struct sysentvec elf64_freebsd_sysvec_la48 = {
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
- SV_TIMEKEEP,
+ SV_TIMEKEEP | SV_RNG_SEED_VER,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,
@@ -107,7 +107,7 @@ struct sysentvec elf64_freebsd_sysvec_la57 = {
.sv_fixlimit = NULL,
.sv_maxssiz = NULL,
.sv_flags = SV_ABI_FREEBSD | SV_ASLR | SV_LP64 | SV_SHP |
- SV_TIMEKEEP,
+ SV_TIMEKEEP | SV_RNG_SEED_VER,
.sv_set_syscall_retval = cpu_set_syscall_retval,
.sv_fetch_syscall_args = cpu_fetch_syscall_args,
.sv_syscallnames = syscallnames,