]> git.itanic.dy.fi Git - linux-stable/commit
efi: stub: use random seed from EFI variable
authorJason A. Donenfeld <Jason@zx2c4.com>
Tue, 22 Nov 2022 02:04:01 +0000 (03:04 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Thu, 1 Dec 2022 08:51:21 +0000 (09:51 +0100)
commita89474aaf7cf27f2299e0a00fb64c94b6ad338a9
tree6852ddaaee9eb15a62fe208eec86f1489d21182e
parent63ffb573df66aea034d07fd00483d0a3cd4fed66
efi: stub: use random seed from EFI variable

EFI has a rather unique benefit that it has access to some limited
non-volatile storage, where the kernel can store a random seed. Read
that seed in EFISTUB and concatenate it with other seeds we wind up
passing onward to the kernel in the configuration table. This is
complementary to the current other two sources - previous bootloaders,
and the EFI RNG protocol.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
[ardb: check for non-NULL RNG protocol pointer, call GetVariable()
       without buffer first to obtain the size]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/random.c