Commit 62b71cd7 authored by Oleksandr Tymoshenko's avatar Oleksandr Tymoshenko Committed by Ard Biesheuvel
Browse files

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: bad267f9 ("efi: verify that variable services are supported")
Signed-off-by: default avatarOleksandr Tymoshenko <ovt@google.com>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent df7ecce8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;