]> git.baikalelectronics.ru Git - kernel.git/commit
random: use arch_get_random*_early() in random_init()
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Fri, 28 Oct 2022 16:00:42 +0000 (17:00 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Fri, 28 Oct 2022 22:24:03 +0000 (00:24 +0200)
commitc1a562f99aa308513692c769f14753557107968d
tree906940f765a2069c49accb4e225785250b59f622
parent7689f6fc3c0ac8e2a5f2b04880442b7c673cebac
random: use arch_get_random*_early() in random_init()

While reworking the archrandom handling, commit d816479b29cc ("random:
handle archrandom with multiple longs") switched to the non-early
archrandom helpers in random_init(), which broke initialization of the
entropy pool from the arm64 random generator.

Indeed at that point the arm64 CPU features, which verify that all CPUs
have compatible capabilities, are not finalized so arch_get_random_seed_longs()
is unsuccessful. Instead random_init() should use the _early functions,
which check only the boot CPU on arm64. On other architectures the
_early functions directly call the normal ones.

Fixes: d816479b29cc ("random: handle archrandom with multiple longs")
Cc: stable@vger.kernel.org
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/char/random.c