Skip to content

x86/efi: Disregard stale EFI config tables after kexec

Ard Biesheuvel linux-efi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2x86/efi: Disregard the INITRD and MEMATTR config tables after kexecarch/x86/platform/efi/efi.c arch/x86/platform/efi/quirks.c include/linux/efi.h+29 -40 replies
2/2efi/tpm: Allocate the event log from EFI loader data againarch/x86/platform/efi/efi.c drivers/firmware/efi/libstub/tpm.c+7 -10 replies

Reviews trailers per patch

None of the 2 patches has a Reviewed-by or Acked-by.

PatchJasmeet (Jazz) Bhatia
SeriesT-b
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] x86/efi: Disregard stale EFI config tables after kexec

From: Ard Biesheuvel <[email protected]>

On x86, kexec passes the firmware's EFI configuration table array on to the next kernel as-is, including tables that reside in memory that has been released or repurposed since, and may therefore have been clobbered by the time the next kernel gets to parse them.

Patch #1 wires up efi_config_table_is_usable() for x86, and uses it to disregard the INITRD and Memory Attributes tables when booting via kexec. This fixes a panic when kexec'ing without an initrd, and supersedes the existing handling of the Memory Attributes table, which does not cover all cases.

Patch #2 does the same for the TPM event log table, so that the EFI stub can allocate it as EFI loader data again without regressing kexec. This fixes hibernation on systems where the ACPI reclaim allocation that is currently used for the event log ends up at a different address on each boot, resulting in an inconsistent E820 map.

Cc Jasmeet (Jazz) Bhatia <[email protected]>

Ard Biesheuvel (2):
x86/efi: Disregard the INITRD and MEMATTR config tables after kexec efi/tpm: Allocate the event log from EFI loader data again

 arch/x86/platform/efi/efi.c        | 32 ++++++++++++++++++++++++++++++
 arch/x86/platform/efi/quirks.c     |  4 ----
 drivers/firmware/efi/libstub/tpm.c |  2 +-
 include/linux/efi.h                |  3 +++
 4 files changed, 36 insertions(+), 5 deletions(-)

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4

Signature · 1 line
2.56.1.750.gf70dc682cf-goog