kernel_samsung_a53x/drivers/firmware/efi
Ard Biesheuvel 206b7d66a4 efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption
commit 77d48d39e99170b528e4f2e9fc5d1d64cdedd386 upstream.

The TPM event log table is a Linux specific construct, where the data
produced by the GetEventLog() boot service is cached in memory, and
passed on to the OS using an EFI configuration table.

The use of EFI_LOADER_DATA here results in the region being left
unreserved in the E820 memory map constructed by the EFI stub, and this
is the memory description that is passed on to the incoming kernel by
kexec, which is therefore unaware that the region should be reserved.

Even though the utility of the TPM2 event log after a kexec is
questionable, any corruption might send the parsing code off into the
weeds and crash the kernel. So let's use EFI_ACPI_RECLAIM_MEMORY
instead, which is always treated as reserved by the E820 conversion
logic.

Cc: <stable@vger.kernel.org>
Reported-by: Breno Leitao <leitao@debian.org>
Tested-by: Usama Arif <usamaarif642@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-23 23:21:31 +01:00
..
libstub efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption 2024-11-23 23:21:31 +01:00
test
apple-properties.c
arm-runtime.c efi: runtime: Fix potential overflow of soft-reserved region size 2024-11-18 22:25:34 +01:00
capsule-loader.c efi/capsule-loader: fix incorrect allocation size 2024-11-18 23:18:29 +01:00
capsule.c
cper-arm.c
cper-x86.c
cper.c
dev-path-parser.c
earlycon.c
efi-bgrt.c
efi-init.c efi: Don't add memblocks for soft-reserved memory 2024-11-18 22:25:34 +01:00
efi-pstore.c
efi.c
efibc.c
efivars.c
embedded-firmware.c
esrt.c
fake_mem.c
fake_mem.h
fdtparams.c efi: xen: Set EFI_PARAVIRT for Xen dom0 boot on all architectures 2024-11-19 14:19:35 +01:00
Kconfig
Makefile
memattr.c
memmap.c efi/x86: Free EFI memory map only when installing a new one. 2024-11-19 14:19:35 +01:00
mokvar-table.c
rci2-table.c
reboot.c
riscv-runtime.c efi: runtime: Fix potential overflow of soft-reserved region size 2024-11-18 22:25:34 +01:00
runtime-map.c
runtime-wrappers.c
tpm.c
vars.c efivarfs: Request at most 512 bytes for variable names 2024-11-19 09:22:41 +01:00
x86_fake_mem.c