mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
efi: fix panic in kdump kernel
[ Upstream commit 62b71cd73d41ddac6b1760402bbe8c4932e23531 ]
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: bad267f9e1 ("efi: verify that variable services are supported")
Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
21c7c00dae
commit
b9d103aca8
@@ -194,6 +194,8 @@ static bool generic_ops_supported(void)
|
|||||||
|
|
||||||
name_size = sizeof(name);
|
name_size = sizeof(name);
|
||||||
|
|
||||||
|
if (!efi.get_next_variable)
|
||||||
|
return false;
|
||||||
status = efi.get_next_variable(&name_size, &name, &guid);
|
status = efi.get_next_variable(&name_size, &name, &guid);
|
||||||
if (status == EFI_UNSUPPORTED)
|
if (status == EFI_UNSUPPORTED)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user