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: <Z5Hja30Wb94uGQ3L@darkstar.users.ipa.redhat.com>
Date: Thu, 23 Jan 2025 14:36:27 +0800
From: Dave Young <dyoung@...hat.com>
To: Ard Biesheuvel <ardb@...nel.org>, Usama Arif <usamaarif642@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
	Breno Leitao <leitao@...ian.org>, kexec@...ts.infradead.org,
	x86@...nel.org
Subject: [PATCH] x86/efi: skip memattr table on kexec boot

efi_memattr_init() added a sanity check to avoid firmware caused corruption.
The check is based on efi memmap entry numbers, but kexec only takes the
runtime related memmap entries thus this caused many false warnings, see
below thread for details:

https://lore.kernel.org/all/20250108215957.3437660-2-usamaarif642@gmail.com/

Ard suggests to skip the efi memattr table in kexec, this makes sense because
those memattr fixups are not critical.

Reported-by: Breno Leitao <leitao@...ian.org>
Reported-and-tested-by: Usama Arif <usamaarif642@...il.com>
Suggested-by: Ard Biesheuvel <ardb@...nel.org>
Signed-off-by: Dave Young <dyoung@...hat.com>

diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 846bf49f2508..553f330198f2 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -561,6 +561,11 @@ int __init efi_reuse_config(u64 tables, int nr_tables)
 
 		if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID))
 			((efi_config_table_64_t *)p)->table = data->smbios;
+
+		/* Do not bother to play with mem attr table across kexec */
+		if (!efi_guidcmp(guid, EFI_MEMORY_ATTRIBUTES_TABLE_GUID))
+			((efi_config_table_64_t *)p)->table = EFI_INVALID_TABLE_ADDR;
+
 		p += sz;
 	}
 	early_memunmap(tablep, nr_tables * sz);


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ