android_kernel_motorola_sm6225/init
Kees Cook d7b3bc8b4f random: move rand_initialize() earlier
commit d55535232c3dbde9a523a9d10d68670f5fe5dec3 upstream.

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>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-06-25 11:48:57 +02:00
..
calibrate.c
do_mounts.c
do_mounts.h
do_mounts_initrd.c
do_mounts_md.c
do_mounts_rd.c
init_task.c fgraph: Initialize tracing_graph_pause at task creation 2021-02-13 13:51:13 +01:00
initramfs.c initramfs: don't free a non-existent initrd 2019-10-01 08:26:09 +02:00
Kconfig kbuild: add CONFIG_LD_IS_LLD 2022-03-11 10:15:12 +01:00
main.c random: move rand_initialize() earlier 2022-06-25 11:48:57 +02:00
Makefile
noinitramfs.c
version.c