summaryrefslogtreecommitdiffstats
path: root/drivers/firmware/efi/tpm.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2020-08-08 01:41:01 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2020-08-08 01:41:01 +0200
commit9e8238020c5beba64e7ffafbb7ea0fb02fe68270 (patch)
tree37c7fd953cfa7ebd3d6c476bc4c7d4de2302cdc3 /drivers/firmware/efi/tpm.c
parentInput: elan_i2c - add more hardware ID for Lenovo laptops (diff)
parentInput: exc3000 - add support to query model and fw_version (diff)
downloadlinux-9e8238020c5beba64e7ffafbb7ea0fb02fe68270.tar.xz
linux-9e8238020c5beba64e7ffafbb7ea0fb02fe68270.zip
Merge branch 'next' into for-linus
Prepare input updates for 5.9 merge window.
Diffstat (limited to 'drivers/firmware/efi/tpm.c')
-rw-r--r--drivers/firmware/efi/tpm.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index 31f9f0e369b9..c1955d320fec 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -16,7 +16,7 @@
int efi_tpm_final_log_size;
EXPORT_SYMBOL(efi_tpm_final_log_size);
-static int tpm2_calc_event_log_size(void *data, int count, void *size_info)
+static int __init tpm2_calc_event_log_size(void *data, int count, void *size_info)
{
struct tcg_pcr_event2_head *header;
int event_size, size = 0;
@@ -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));