efi: random: refresh non-volatile random seed when RNG is initialized
authorJason A. Donenfeld <Jason@zx2c4.com>
Wed, 16 Nov 2022 16:16:42 +0000 (17:16 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 Nov 2022 13:53:36 +0000 (14:53 +0100)
commite7b813b32a42a3a6281a4fd9ae7700a0257c1d50
tree495840781b62b3861c3857eac2b3d67944509f7e
parent898f1e5c3741ccabda5653f180051cd4aeff3794
efi: random: refresh non-volatile random seed when RNG is initialized

EFI has a rather unique benefit that it has access to some limited
non-volatile storage, where the kernel can store a random seed. Register
a notification for when the RNG is initialized, and at that point, store
a new random seed.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
drivers/firmware/efi/efi.c