projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a066397
)
libstub,tpm: do not ignore failure case when reading final event log
author
Gregory Price
<gourry@gourry.net>
Fri, 13 Sep 2024 23:19:54 +0000
(19:19 -0400)
committer
Ard Biesheuvel
<ardb@kernel.org>
Tue, 15 Oct 2024 18:27:30 +0000
(20:27 +0200)
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>
drivers/firmware/efi/libstub/tpm.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/firmware/efi/libstub/tpm.c
b/drivers/firmware/efi/libstub/tpm.c
index d31ea3f351d82407388a1091df2624d1c027f924..a5c6c4f163fce4ff1afb470baa6ca7acabaaada6 100644
(file)
--- a/
drivers/firmware/efi/libstub/tpm.c
+++ b/
drivers/firmware/efi/libstub/tpm.c
@@
-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--;
}