lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190926141234.8271-1-ross.lagerwall@citrix.com>
Date:   Thu, 26 Sep 2019 15:12:34 +0100
From:   Ross Lagerwall <ross.lagerwall@...rix.com>
To:     <linux-efi@...r.kernel.org>
CC:     Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Darren Hart <dvhart@...radead.org>,
        Andy Shevchenko <andy@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        "H. Peter Anvin" <hpa@...or.com>, <x86@...nel.org>,
        <platform-driver-x86@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        "Sai Praneeth" <sai.praneeth.prakhya@...el.com>,
        Ross Lagerwall <ross.lagerwall@...rix.com>
Subject: [PATCH] x86/efi: Don't require non-blocking EFI callbacks

If a backend does not implement non-blocking EFI operations, it implies
that the normal operations are non-blocking. Instead of crashing
dereferencing a NULL pointer, fallback to the normal operations since it
is safe to do so.

Fixes: 5a58bc1b1edc ("efi/x86: Use non-blocking SetVariable() for efi_delete_dummy_variable()")
Fixes: ca0e30dcaa53 ("efi: Add nonblocking option to efi_query_variable_store()")
Signed-off-by: Ross Lagerwall <ross.lagerwall@...rix.com>
---
 arch/x86/platform/efi/quirks.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 3b9fd679cea9..4167f5e8f3e8 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -106,11 +106,13 @@ early_param("efi_no_storage_paranoia", setup_storage_paranoia);
 */
 void efi_delete_dummy_variable(void)
 {
-	efi.set_variable_nonblocking((efi_char16_t *)efi_dummy_name,
-				     &EFI_DUMMY_GUID,
-				     EFI_VARIABLE_NON_VOLATILE |
-				     EFI_VARIABLE_BOOTSERVICE_ACCESS |
-				     EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL);
+	efi_set_variable_t *set_variable = efi.set_variable_nonblocking ?:
+					   efi.set_variable;
+
+	set_variable((efi_char16_t *)efi_dummy_name, &EFI_DUMMY_GUID,
+		     EFI_VARIABLE_NON_VOLATILE |
+		     EFI_VARIABLE_BOOTSERVICE_ACCESS |
+		     EFI_VARIABLE_RUNTIME_ACCESS, 0, NULL);
 }
 
 /*
@@ -127,10 +129,12 @@ query_variable_store_nonblocking(u32 attributes, unsigned long size)
 {
 	efi_status_t status;
 	u64 storage_size, remaining_size, max_size;
+	efi_query_variable_info_t *query_variable_info =
+		efi.query_variable_info_nonblocking ?:
+		efi.query_variable_info;
 
-	status = efi.query_variable_info_nonblocking(attributes, &storage_size,
-						     &remaining_size,
-						     &max_size);
+	status = query_variable_info(attributes, &storage_size,
+				     &remaining_size, &max_size);
 	if (status != EFI_SUCCESS)
 		return status;
 
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ