]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
efi/arm64: libstub: Deal gracefully with EFI_RNG_PROTOCOL failure
authorArd Biesheuvel <ardb@kernel.org>
Sat, 26 Sep 2020 08:52:42 +0000 (10:52 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Nov 2020 11:45:36 +0000 (12:45 +0100)
commit8b23af0ef2f7ad76a3b0b734e06244e64f9bd829
treeb1805fda91edd23c691f74dd0891654dfd6aaa4d
parent865013fcf4c3c672ee463c7ead62e9f3b89e87d7
efi/arm64: libstub: Deal gracefully with EFI_RNG_PROTOCOL failure

commit d32de9130f6c79533508e2c7879f18997bfbe2a0 upstream.

Currently, on arm64, we abort on any failure from efi_get_random_bytes()
other than EFI_NOT_FOUND when it comes to setting the physical seed for
KASLR, but ignore such failures when obtaining the seed for virtual
KASLR or for early seeding of the kernel's entropy pool via the config
table. This is inconsistent, and may lead to unexpected boot failures.

So let's permit any failure for the physical seed, and simply report
the error code if it does not equal EFI_NOT_FOUND.

Cc: <stable@vger.kernel.org> # v5.8+
Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/fdt.c