Skip to contentSkip to conversation

efi/tpm: Differentiate missing and invalid final event log table.

PATCH Applied Michal Suchanek 3 participants 3 messages Jul 8, 2021 – Jul 16, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 efi/tpm: Differentiate missing and invalid final event log table.

Missing TPM final event log table is not a firmware bug.

Clearly if providing event log in the old format makes the final event log invalid it should not be provided at least in that case.

Fixes b4f1874c6216 ("tpm: check event log version before reading final events")
---
 drivers/firmware/efi/tpm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/firmware/efi/tpm.c +5 -3
index c1955d320fec..8f665678e9e3 100644
@@ -62,9 +62,11 @@ int __init efi_tpm_eventlog_init(void)
 	tbl_size = sizeof(*log_tbl) + log_tbl->size;
 	memblock_reserve(efi.tpm_log, tbl_size);
 
-	if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR ||
-	    log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
-		pr_warn(FW_BUG "TPM Final Events table missing or invalid\n");
+	if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) {
+		pr_info("TPM Final Events table not present\n");
+		goto out;
+	} else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
+		pr_warn(FW_BUG "TPM Final Events table invalid\n");
 		goto out;
 	}
 
Signature · 1 line
2.26.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · Michal Suchanek

Missing TPM final event log table is not a firmware bug.

Clearly if providing event log in the old format makes the final event log invalid it should not be provided at least in that case.

Fixes b4f1874c6216 ("tpm: check event log version before reading final events")
---
 drivers/firmware/efi/tpm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/firmware/efi/tpm.c +5 -3
index c1955d320fec..8f665678e9e3 100644
@@ -62,9 +62,11 @@ int __init efi_tpm_eventlog_init(void)
 	tbl_size = sizeof(*log_tbl) + log_tbl->size;
 	memblock_reserve(efi.tpm_log, tbl_size);
 
-	if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR ||
-	    log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
-		pr_warn(FW_BUG "TPM Final Events table missing or invalid\n");
+	if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) {
+		pr_info("TPM Final Events table not present\n");
+		goto out;
+	} else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
+		pr_warn(FW_BUG "TPM Final Events table invalid\n");
 		goto out;
 	}
 
Signature · 1 line
2.26.2

/Jarkko

maintainer Applied
#2 lore raw
Quoted 32 lines · Jarkko Sakkinen
Quoted 30 lines · Michal Suchanek

Missing TPM final event log table is not a firmware bug.

Clearly if providing event log in the old format makes the final event log invalid it should not be provided at least in that case.

Fixes b4f1874c6216 ("tpm: check event log version before reading final events")
---
 drivers/firmware/efi/tpm.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/firmware/efi/tpm.c +5 -3
index c1955d320fec..8f665678e9e3 100644
@@ -62,9 +62,11 @@ int __init efi_tpm_eventlog_init(void)
      tbl_size = sizeof(*log_tbl) + log_tbl->size;
      memblock_reserve(efi.tpm_log, tbl_size);
 
-     if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR ||
-         log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
-             pr_warn(FW_BUG "TPM Final Events table missing or invalid\n");
+     if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) {
+             pr_info("TPM Final Events table not present\n");
+             goto out;
+     } else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) {
+             pr_warn(FW_BUG "TPM Final Events table invalid\n");
              goto out;
      }
 
Quoted 7 lines
Quoted 4 lines

--
2.26.2

Queued as a fix, thanks