mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
libstub,tpm: do not ignore failure case when reading final event log
Current code fails to check for an error case when reading events from final event log to calculate offsets. Check the error case, and break early because all subsequent calls will also fail. Signed-off-by: Gregory Price <gourry@gourry.net> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
a066397e8e
commit
63971b0f51
@ -124,6 +124,9 @@ static void efi_retrieve_tcg2_eventlog(int version, efi_physical_addr_t log_loca
|
||||
event_size = __calc_tpm2_event_size(header,
|
||||
(void *)(long)log_location,
|
||||
false);
|
||||
/* If calc fails this is a malformed log */
|
||||
if (!event_size)
|
||||
break;
|
||||
final_events_size += event_size;
|
||||
i--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user