Commit e6d654e9 authored by Gregory Price's avatar Gregory Price Committed by Ard Biesheuvel
Browse files

tpm: fix signed/unsigned bug when checking event logs



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: be59d57f ("efi/tpm: Fix sanity check of unsigned tbl_size being less than zero")
Signed-off-by: default avatarGregory Price <gourry@gourry.net>
Reviewed-by: default avatarIlias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent c004703e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment