]> Git Repo - linux.git/commitdiff
x86/efi: skip memattr table on kexec boot
authorDave Young <[email protected]>
Thu, 23 Jan 2025 06:36:27 +0000 (14:36 +0800)
committerArd Biesheuvel <[email protected]>
Thu, 23 Jan 2025 08:58:43 +0000 (09:58 +0100)
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[email protected]/

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

Fixes: 8fbe4c49c0cc ("efi/memattr: Ignore table if the size is clearly bogus")
Cc: <[email protected]> # v6.13+
Reported-by: Breno Leitao <[email protected]>
Reported-and-tested-by: Usama Arif <[email protected]>
Suggested-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Dave Young <[email protected]>
Signed-off-by: Ard Biesheuvel <[email protected]>
arch/x86/platform/efi/quirks.c

index 846bf49f2508da980f8f4a30e19e61e313a3c697..553f330198f2f32ad87b112c34d4912258fa4d09 100644 (file)
@@ -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);
This page took 0.06581 seconds and 4 git commands to generate.