[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240323063334.735219-1-ovt@google.com>
Date: Sat, 23 Mar 2024 06:33:33 +0000
From: Oleksandr Tymoshenko <ovt@...gle.com>
To: Ard Biesheuvel <ardb@...nel.org>, Johan Hovold <johan+linaro@...nel.org>
Cc: ovt@...gle.com, stable@...r.kernel.org, linux-efi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2] 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")
Cc: stable@...r.kernel.org
Signed-off-by: Oleksandr Tymoshenko <ovt@...gle.com>
---
Changes in v2:
- Style fix
- Added Cc: stable
- Added Fixes: trailer
---
drivers/firmware/efi/efi.c | 2 ++
1 file changed, 2 insertions(+)
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;
--
2.44.0.396.g6e790dbe36-goog
Powered by blists - more mailing lists