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")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>

authored by Michal Suchanek and committed by Ard Biesheuvel 674a9f1f e73f0f0e

+5 -3
+5 -3
drivers/firmware/efi/tpm.c
··· 62 62 tbl_size = sizeof(*log_tbl) + log_tbl->size; 63 63 memblock_reserve(efi.tpm_log, tbl_size); 64 64 65 - if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR || 66 - log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { 67 - pr_warn(FW_BUG "TPM Final Events table missing or invalid\n"); 65 + if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) { 66 + pr_info("TPM Final Events table not present\n"); 67 + goto out; 68 + } else if (log_tbl->version != EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) { 69 + pr_warn(FW_BUG "TPM Final Events table invalid\n"); 68 70 goto out; 69 71 } 70 72