Attention is currently required from: Jeremy Soller, Christian Walter.
Hello Jeremy Soller,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/73297
to review the following change.
Change subject: security/tpm/tspi/log: Respect cbmem TPM log size when copying preram entries ......................................................................
security/tpm/tspi/log: Respect cbmem TPM log size when copying preram entries
The preram TPM log was being copied to the end of the cbmem TPM log no matter what the size of the cbmem TPM log was. Eventually, it would overwrite anything else in cmbem beyond the TPM log.
Fixes performing multiple S3 suspends with TPM_MEASURED_BOOT enabled.
Change-Id: If76299e68eb5ed2ed20c947be35cea46c51fcdec Signed-off-by: Jeremy Soller jeremy@system76.com Signed-off-by: Tim Crawford tcrawford@system76.com --- M src/security/tpm/tspi/log.c 1 file changed, 22 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/97/73297/1
diff --git a/src/security/tpm/tspi/log.c b/src/security/tpm/tspi/log.c index 8796c74..0276f22 100644 --- a/src/security/tpm/tspi/log.c +++ b/src/security/tpm/tspi/log.c @@ -144,6 +144,11 @@ int i;
for (i = 0; i < from_log->num_entries; i++) { + if (to_log->num_entries >= to_log->max_entries) { + printk(BIOS_WARNING, "TPM LOG: log table is full\n"); + return; + } + struct tpm_cb_log_entry *tce = &to_log->entries[to_log->num_entries++];
strncpy(tce->name, from_log->entries[i].name, TPM_CB_LOG_PCR_HASH_NAME - 1);