Files
linux-stable-mirror/drivers
Gregory Price 839e76cea2 tpm: fix signed/unsigned bug when checking event logs
[ Upstream commit e6d654e9f5 ]

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: be59d57f98 ("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-14 19:47:47 +01:00
..
2024-10-17 15:08:29 +02:00
2024-12-14 19:47:46 +01:00
2024-12-14 19:47:46 +01:00