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: <20190901065828.7762-1-adam.zerella@gmail.com>
Date:   Sun,  1 Sep 2019 16:58:28 +1000
From:   Adam Zerella <adam.zerella@...il.com>
To:     unlisted-recipients:; (no To-header on input)
Cc:     Adam Zerella <adam.zerella@...il.com>,
        Boris Ostrovsky <boris.ostrovsky@...cle.com>,
        Juergen Gross <jgross@...e.com>,
        Stefano Stabellini <sstabellini@...nel.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,
        xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org
Subject: [PATCH] x86/xen/efi: Fix EFI variable 'name' type conversion

This resolves a type conversion from 'char *' to 'unsigned short'.
and static usage warning as hinted by Sparse.

Signed-off-by: Adam Zerella <adam.zerella@...il.com>
---
 arch/x86/xen/efi.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c
index 0d3365cb64de..1d4eff6c6f06 100644
--- a/arch/x86/xen/efi.c
+++ b/arch/x86/xen/efi.c
@@ -118,8 +118,8 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 	unsigned long size;
 
 	size = sizeof(secboot);
-	status = efi.get_variable(L"SecureBoot", &efi_variable_guid,
-				  NULL, &size, &secboot);
+	status = efi.get_variable((efi_char16_t *)L"SecureBoot",
+				  &efi_variable_guid, NULL, &size, &secboot);
 
 	if (status == EFI_NOT_FOUND)
 		return efi_secureboot_mode_disabled;
@@ -128,8 +128,8 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 		goto out_efi_err;
 
 	size = sizeof(setupmode);
-	status = efi.get_variable(L"SetupMode", &efi_variable_guid,
-				  NULL, &size, &setupmode);
+	status = efi.get_variable((efi_char16_t *)L"SetupMode",
+				  &efi_variable_guid, NULL, &size, &setupmode);
 
 	if (status != EFI_SUCCESS)
 		goto out_efi_err;
@@ -139,8 +139,8 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 
 	/* See if a user has put the shim into insecure mode. */
 	size = sizeof(moksbstate);
-	status = efi.get_variable(L"MokSBStateRT", &shim_guid,
-				  NULL, &size, &moksbstate);
+	status = efi.get_variable((efi_char16_t *)L"MokSBStateRT",
+				  &shim_guid, NULL, &size, &moksbstate);
 
 	/* If it fails, we don't care why. Default to secure. */
 	if (status != EFI_SUCCESS)
@@ -158,7 +158,7 @@ static enum efi_secureboot_mode xen_efi_get_secureboot(void)
 	return efi_secureboot_mode_unknown;
 }
 
-void __init xen_efi_init(struct boot_params *boot_params)
+static void __init xen_efi_init(struct boot_params *boot_params)
 {
 	efi_system_table_t *efi_systab_xen;
 
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ