]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - drivers/firmware/efi/tpm.c
Merge tag 'efi-fixes-for-v5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git...
[thirdparty/linux.git] / drivers / firmware / efi / tpm.c
index 55b031d2c989074ec9f3b53f9662865d2e448122..c1955d320fecd6548cf99e9692562bac10f3998f 100644 (file)
@@ -62,8 +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)
+       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");
                goto out;
+       }
 
        final_tbl = early_memremap(efi.tpm_final_log, sizeof(*final_tbl));