Skip to content

Commit 64b45dd

Browse files
daveyoungardbiesheuvel
authored andcommitted
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. Fixes: 8fbe4c4 ("efi/memattr: Ignore table if the size is clearly bogus") Cc: <stable@vger.kernel.org> # v6.13+ Reported-by: Breno Leitao <leitao@debian.org> Reported-and-tested-by: Usama Arif <usamaarif642@gmail.com> Suggested-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Dave Young <dyoung@redhat.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent b5d1e6e commit 64b45dd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

arch/x86/platform/efi/quirks.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ int __init efi_reuse_config(u64 tables, int nr_tables)
561561

562562
if (!efi_guidcmp(guid, SMBIOS_TABLE_GUID))
563563
((efi_config_table_64_t *)p)->table = data->smbios;
564+
565+
/* Do not bother to play with mem attr table across kexec */
566+
if (!efi_guidcmp(guid, EFI_MEMORY_ATTRIBUTES_TABLE_GUID))
567+
((efi_config_table_64_t *)p)->table = EFI_INVALID_TABLE_ADDR;
568+
564569
p += sz;
565570
}
566571
early_memunmap(tablep, nr_tables * sz);

0 commit comments

Comments
 (0)