mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
Merge tag 'random-6.1-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random
Pull random number generator fix from Jason Donenfeld: "One fix from Jean-Philippe Brucker, addressing a regression in which early boot code on ARM64 would use the non-_early variant of the arch_get_random family of functions, resulting in the architectural random number generator appearing unavailable during that early phase of boot. The fix simply changes arch_get_random*() to arch_get_random*_early(). This distinction between these two functions is a bit of an old wart I'm not a fan of, and for 6.2 I'll see if I can make obsolete the _early variant, so that one function does the right thing in all contexts without overhead" * tag 'random-6.1-rc3-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/crng/random: random: use arch_get_random*_early() in random_init()
This commit is contained in:
@@ -791,13 +791,13 @@ void __init random_init_early(const char *command_line)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (i = 0, arch_bits = sizeof(entropy) * 8; i < ARRAY_SIZE(entropy);) {
|
for (i = 0, arch_bits = sizeof(entropy) * 8; i < ARRAY_SIZE(entropy);) {
|
||||||
longs = arch_get_random_seed_longs(entropy, ARRAY_SIZE(entropy) - i);
|
longs = arch_get_random_seed_longs_early(entropy, ARRAY_SIZE(entropy) - i);
|
||||||
if (longs) {
|
if (longs) {
|
||||||
_mix_pool_bytes(entropy, sizeof(*entropy) * longs);
|
_mix_pool_bytes(entropy, sizeof(*entropy) * longs);
|
||||||
i += longs;
|
i += longs;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
longs = arch_get_random_longs(entropy, ARRAY_SIZE(entropy) - i);
|
longs = arch_get_random_longs_early(entropy, ARRAY_SIZE(entropy) - i);
|
||||||
if (longs) {
|
if (longs) {
|
||||||
_mix_pool_bytes(entropy, sizeof(*entropy) * longs);
|
_mix_pool_bytes(entropy, sizeof(*entropy) * longs);
|
||||||
i += longs;
|
i += longs;
|
||||||
|
|||||||
Reference in New Issue
Block a user