freebsd-dev/sys
Conrad Meyer 10b1a17594 arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed
There is no functional change for the existing Fortuna random(4)
implementation, which remains the default in GENERIC.

In the FenestrasX model, when the root CSPRNG is reseeded from pools due to
an (infrequent) timer, child CSPRNGs can cheaply detect this condition and
reseed.  To do so, they just need to track an additional 64-bit value in the
associated state, and compare it against the root seed version (generation)
on random reads.

This revision integrates arc4random(9) into that model without substantially
changing the design or implementation of arc4random(9).  The motivation is
that arc4random(9) is immediately reseeded when the backing random(4)
implementation has additional entropy.  This is arguably most important
during boot, when fenestrasX is reseeding at 1, 3, 9, 27, etc., second
intervals.  Today, arc4random(9) has a hardcoded 300 second reseed window.
Without this mechanism, if arc4random(9) gets weak entropy during initial
seed (and arc4random(9) is used early in boot, so this is quite possible),
it may continue to emit poorly seeded output for 5 minutes.  The FenestrasX
push-reseed scheme corrects consumers, like arc4random(9), as soon as
possible.

Reviewed by:	markm
Approved by:	csprng (markm)
Differential Revision:	https://reviews.freebsd.org/D22838
2020-10-10 21:48:06 +00:00
..
amd64 Create in-tree LINT files 2020-10-09 01:48:14 +00:00
arm arm: Check dtb version against the one we're expecting to find 2020-10-10 07:20:59 +00:00
arm64 Create in-tree LINT files 2020-10-09 01:48:14 +00:00
bsm
cam cam: Add quirk for Samsung MZ7* behind a SATA-to-SAS interposer 2020-10-07 05:44:35 +00:00
cddl loader: zfs should support bootonce an nextboot 2020-09-21 09:01:10 +00:00
compat LinuxKPI: add a bitfield.h implementation. 2020-10-07 22:07:26 +00:00
conf Add "Fenestras X" alternative /dev/random implementation 2020-10-10 21:45:59 +00:00
contrib zfs: use cache_rename 2020-10-10 04:18:49 +00:00
crypto libmd: fix assembly optimized skein implementation 2020-10-01 21:05:50 +00:00
ddb ddb: clean up empty lines in .c and .h files 2020-09-01 22:14:30 +00:00
dev arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed 2020-10-10 21:48:06 +00:00
dts Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
fs cache: fix vexec panic when racing against vgone 2020-10-09 19:10:00 +00:00
gdb gdb(4): Don't escape GDB special characters at application layer 2020-09-30 14:55:54 +00:00
geom Move kernel env global variables, etc to sys/kenv.h 2020-10-07 06:16:37 +00:00
gnu Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
i386 Create in-tree LINT files 2020-10-09 01:48:14 +00:00
isa
kern vfs: support lockless dirfd lookups 2020-10-10 03:48:17 +00:00
kgssapi State kgssapi dependency on xdr. 2020-09-17 22:29:38 +00:00
libkern arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed 2020-10-10 21:48:06 +00:00
mips Print symbol index for unsupported relocation types 2020-10-07 18:48:10 +00:00
modules modules/crypto: reenable assembly optimized skein implementation 2020-10-10 01:13:14 +00:00
net Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. 2020-10-09 12:06:43 +00:00
net80211 net80211: whitespace 2020-10-07 22:52:24 +00:00
netgraph ng_l2tp: Fix callout synchronization in the rexmit timeout handler 2020-09-25 18:55:50 +00:00
netinet Stop sending tiny new data segments during SACK recovery 2020-10-09 12:44:56 +00:00
netinet6 Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. 2020-10-09 12:06:43 +00:00
netipsec net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netpfil net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
netsmb net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
nfs nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsclient nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nfsserver nfs: clean up empty lines in .c and .h files 2020-09-01 21:25:39 +00:00
nlm nlm: clean up empty lines in .c and .h files 2020-09-01 22:14:52 +00:00
ofed infiniband: Appease Coverty 2020-08-31 16:17:28 +00:00
opencrypto Simplify swcr_authcompute() after removal of deprecated algorithms. 2020-10-06 18:07:52 +00:00
powerpc Create in-tree LINT files 2020-10-09 01:48:14 +00:00
riscv RISC-V LINT kernel config 2020-10-09 14:45:41 +00:00
rpc Fix a potential memory leak in the NFS over TLS handling code. 2020-09-05 00:50:52 +00:00
security mac_framework.h: fix build with DEBUG_VFS_LOCKS and !MAC 2020-09-03 20:30:52 +00:00
sys arc4random(9): Integrate with RANDOM_FENESTRASX push-reseed 2020-10-10 21:48:06 +00:00
teken Do a sweep and remove most WARNS=6 settings 2020-10-01 01:10:51 +00:00
tests Add small tool to invoke kernel test framework tests. 2020-09-02 09:20:40 +00:00
tools Brand our DTS with the Linux version it was imported from 2020-10-10 07:18:51 +00:00
ufs Do not leak B_BARRIER. 2020-10-08 22:41:02 +00:00
vm Use unlocked page lookup for inmem() to avoid object lock contention 2020-10-09 23:49:42 +00:00
x86 timer_restore is now unused, remove it 2020-10-08 20:56:11 +00:00
xdr xdr: clean up empty lines in .c and .h files 2020-09-01 22:13:28 +00:00
xen xen: clean up empty lines in .c and .h files 2020-09-01 21:21:55 +00:00
Makefile