diff options
author | Oleksandr Tymoshenko <ovt@google.com> | 2024-03-23 07:33:33 +0100 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2024-03-24 09:28:33 +0100 |
commit | 62b71cd73d41ddac6b1760402bbe8c4932e23531 (patch) | |
tree | 09e447a00f1f8a8b0f83dcf9de72955a1798c1b1 | |
parent | x86/efistub: Don't clear BSS twice in mixed mode (diff) | |
download | linux-62b71cd73d41ddac6b1760402bbe8c4932e23531.tar.xz linux-62b71cd73d41ddac6b1760402bbe8c4932e23531.zip |
efi: fix panic in kdump kernel
Check if get_next_variable() is actually valid pointer before
calling it. In kdump kernel this method is set to NULL that causes
panic during the kexec-ed kernel boot.
Tested with QEMU and OVMF firmware.
Fixes: bad267f9e18f ("efi: verify that variable services are supported")
Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-rw-r--r-- | drivers/firmware/efi/efi.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 8859fb0b006d..fdf07dd6f459 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -203,6 +203,8 @@ static bool generic_ops_supported(void) name_size = sizeof(name); + if (!efi.get_next_variable) + return false; status = efi.get_next_variable(&name_size, &name, &guid); if (status == EFI_UNSUPPORTED) return false; |