kernel_samsung_a53x/drivers/firmware/efi
Gregory Price b6a33d3d54 tpm: fix signed/unsigned bug when checking event logs
[ Upstream commit e6d654e9f5a97742cfe794b1c4bb5d3fb2d25e98 ]

A prior bugfix that fixes a signed/unsigned error causes
another signed unsigned error.

A situation where log_tbl->size is invalid can cause the
size passed to memblock_reserve to become negative.

log_size from the main event log is an unsigned int, and
the code reduces to the following

u64 value = (int)unsigned_value;

This results in sign extension, and the value sent to
memblock_reserve becomes effectively negative.

Fixes: be59d57f9806 ("efi/tpm: Fix sanity check of unsigned tbl_size being less than zero")
Signed-off-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-12-17 13:24:00 +01:00
..
libstub Revert "efistub/tpm: Use ACPI reclaim memory for event log to avoid corruption" 2024-11-24 00:23:16 +01:00
test
apple-properties.c
arm-runtime.c
capsule-loader.c
capsule.c
cper-arm.c
cper-x86.c
cper.c
dev-path-parser.c
earlycon.c
efi-bgrt.c
efi-init.c
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
runtime-map.c
runtime-wrappers.c
tpm.c tpm: fix signed/unsigned bug when checking event logs 2024-12-17 13:24:00 +01:00
vars.c
x86_fake_mem.c