summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/tpm.c
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2020-05-22 20:06:25 +0200
committerBorislav Petkov <bp@suse.de>2020-05-22 20:06:25 +0200
commit9bb4cbf4862dfa139f73e12912129e5b76baea1a (patch)
tree281445c282163ff286d7eb5b6b60f1a5eb608625 /drivers/firmware/efi/tpm.c
parentb9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce (diff)
parentb4f1874c62168159fdb419ced4afc77c1b51c475 (diff)
Merge tag 'efi-fixes-for-v5.7-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi into efi/urgentefi-urgent-2020-05-24
Pull EFI fixes from Ard Biesheuvel: "- fix EFI framebuffer earlycon for wide fonts - avoid filling screen_info with garbage if the EFI framebuffer is not available - fix a potential host tool build error due to a symbol clash on x86 - work around a EFI firmware bug regarding the binary format of the TPM final events table - fix a missing memory free by reworking the E820 table sizing routine to not do the allocation in the first place - add CPER parsing for firmware errors"
Diffstat (limited to 'drivers/firmware/efi/tpm.c')
-rw-r--r--drivers/firmware/efi/tpm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index 55b031d2c989..c1955d320fec 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -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));