Skip to content

Commit

Permalink
efi: fix panic in kdump kernel
Browse files Browse the repository at this point in the history
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: bad267f ("efi: verify that variable services are supported")
Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
  • Loading branch information
gonzoua authored and ardbiesheuvel committed Mar 24, 2024
1 parent df7ecce commit 62b71cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/firmware/efi/efi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 62b71cd

Please sign in to comment.