]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
Adjust initialization of random(9) so it is usable earlier.
authorjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 10 Feb 2016 18:29:37 +0000 (18:29 +0000)
committerjhb <jhb@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Wed, 10 Feb 2016 18:29:37 +0000 (18:29 +0000)
commit994b59eb759974dd19a85b593e04595ec531056d
tree1eef1a4f008d805dbb8569a65b92557941760b25
parent170d0754a5799a6d6ae10488c9af48165b0acbc8
Adjust initialization of random(9) so it is usable earlier.

A few existing SYSINITs expect the in-kernel PRNG (random(9)) to be
useable at SI_SUB_RANDOM / SI_ORDER_ANY.  However, the random(4) overhaul
merged for 10.0 performs all of its initialization at SI_SUB_DRIVERS
(since it is tied in with creating the /dev/random character device).

This has changed in HEAD where the random initialization is split such
that the in-kernel random(9) is initialized at SI_SUB_RANDOM and the
supporting bits for userland random(4) (such as /dev/random) are initialized
later.

However, the changes in HEAD are large and invasive.  Instead, this change
is being directly committed to stable/10.

This change moves most of the random(9)/random(4) initialization to
SI_SUB_RANDOM with the exception that the creation of the harvesting kernel
process and the /dev/random character device are deferred to new
SYSINITs that run at SI_SUB_DRIVERS.

This fixes the "random device not loaded; using insecure entropy" message
output during boot on some systems.

PR: 205800
Reviewed by: markm, so@
Approved by: so
Approved by: re (gjb)
Tested by: Mark Saad <nonesuch@longcount.org>

git-svn-id: svn://svn.freebsd.org/base/stable/10@295480 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/random/live_entropy_sources.c
sys/dev/random/live_entropy_sources.h
sys/dev/random/random_adaptors.c
sys/dev/random/random_adaptors.h
sys/dev/random/random_harvestq.c
sys/dev/random/randomdev.c
sys/dev/random/randomdev_soft.c