diff options
author | Kees Cook <keescook@chromium.org> | 2019-04-19 23:27:05 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-04-19 23:27:05 -0400 |
commit | d55535232c3dbde9a523a9d10d68670f5fe5dec3 (patch) | |
tree | 43265cdcfde71ed2fdbd562c17f034c28aab15bc /include/linux/random.h | |
parent | eb9d1bf079bb438d1a066d72337092935fc770f6 (diff) | |
download | linux-d55535232c3dbde9a523a9d10d68670f5fe5dec3.tar.gz linux-d55535232c3dbde9a523a9d10d68670f5fe5dec3.tar.bz2 linux-d55535232c3dbde9a523a9d10d68670f5fe5dec3.zip |
random: move rand_initialize() earlier
Right now rand_initialize() is run as an early_initcall(), but it only
depends on timekeeping_init() (for mixing ktime_get_real() into the
pools). However, the call to boot_init_stack_canary() for stack canary
initialization runs earlier, which triggers a warning at boot:
random: get_random_bytes called from start_kernel+0x357/0x548 with crng_init=0
Instead, this moves rand_initialize() to after timekeeping_init(), and moves
canary initialization here as well.
Note that this warning may still remain for machines that do not have
UEFI RNG support (which initializes the RNG pools during setup_arch()),
or for x86 machines without RDRAND (or booting without "random.trust=on"
or CONFIG_RANDOM_TRUST_CPU=y).
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/linux/random.h')
-rw-r--r-- | include/linux/random.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/random.h b/include/linux/random.h index 445a0ea4ff49..13aeaf5a4bd4 100644 --- a/include/linux/random.h +++ b/include/linux/random.h @@ -36,6 +36,7 @@ extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy; extern void get_random_bytes(void *buf, int nbytes); extern int wait_for_random_bytes(void); +extern int __init rand_initialize(void); extern bool rng_is_initialized(void); extern int add_random_ready_callback(struct random_ready_callback *rdy); extern void del_random_ready_callback(struct random_ready_callback *rdy); |