summaryrefslogtreecommitdiffstats
path: root/drivers/virt
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2022-03-31 11:01:01 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2022-03-31 16:43:27 -0400
commit1754abb3e7583c570666fa1e1ee5b317e88c89a0 (patch)
tree3e4afaa65c5a9390d30d0652974e2943b395da45 /drivers/virt
parent0396e46dc46523cba8401a0df84f67cc0b6067ab (diff)
downloadlinux-1754abb3e7583c570666fa1e1ee5b317e88c89a0.tar.bz2
random: mix build-time latent entropy into pool at init
Prior, the "input_pool_data" array needed no real initialization, and so it was easy to mark it with __latent_entropy to populate it during compile-time. In switching to using a hash function, this required us to specifically initialize it to some specific state, which means we dropped the __latent_entropy attribute. An unfortunate side effect was this meant the pool was no longer seeded using compile-time random data. In order to bring this back, we declare an array in rand_initialize() with __latent_entropy and call mix_pool_bytes() on that at init, which accomplishes the same thing as before. We make this __initconst, so that it doesn't take up space at runtime after init. Fixes: 6e8ec2552c7d ("random: use computational hash for entropy extraction") Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'drivers/virt')
0 files changed, 0 insertions, 0 deletions