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)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 29 Sep 2020 13:41:52 +0000 (15:41 +0200)
commitd32de9130f6c79533508e2c7879f18997bfbe2a0
tree84b20813ae0a652d65300c70318746a6a3e27063
parent336af6a4686d885a067ecea8c3c3dd129ba4fc75
efi/arm64: libstub: Deal gracefully with EFI_RNG_PROTOCOL failure

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>
drivers/firmware/efi/libstub/arm64-stub.c
drivers/firmware/efi/libstub/fdt.c