Skip to content

Commit

Permalink
security/tpm/tspi/log-tpm1.c: Clear whole log area on creation
Browse files Browse the repository at this point in the history
The log area was not entirely cleared on creation resulting in
garbage after the last valid lgo entry. It caused the cbmem utility
to parse invalid events and access data outside the log area.
In the TPM2 log sources, the entire area is being cleared, thus the
issue has not been observed.

Change-Id: I7c780b62b1c6507e1dd1806b20b0270e364cde3d
Signed-off-by: Michał Żygowski <[email protected]>
  • Loading branch information
miczyg1 committed Oct 30, 2024
1 parent 99f4a3b commit 532cef5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/security/tpm/tspi/log-tpm1.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void *tpm1_log_cbmem_init(void)
if (!tclt)
return NULL;

memset(tclt, 0, sizeof(*tclt));
memset(tclt, 0, tpm_log_len);
hdr = &tclt->spec_id;

/* Fill in first "header" entry. */
Expand Down

0 comments on commit 532cef5

Please sign in to comment.