summaryrefslogtreecommitdiff
path: root/drivers/firmware/efi/libstub/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/libstub/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/libstub/tpm.c')
-rw-r--r--drivers/firmware/efi/libstub/tpm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/firmware/efi/libstub/tpm.c b/drivers/firmware/efi/libstub/tpm.c
index 1d59e103a2e3..e9a684637b70 100644
--- a/drivers/firmware/efi/libstub/tpm.c
+++ b/drivers/firmware/efi/libstub/tpm.c
@@ -54,7 +54,7 @@ void efi_retrieve_tpm2_eventlog(void)
efi_status_t status;
efi_physical_addr_t log_location = 0, log_last_entry = 0;
struct linux_efi_tpm_eventlog *log_tbl = NULL;
- struct efi_tcg2_final_events_table *final_events_table;
+ struct efi_tcg2_final_events_table *final_events_table = NULL;
unsigned long first_entry_addr, last_entry_addr;
size_t log_size, last_entry_size;
efi_bool_t truncated;
@@ -127,7 +127,8 @@ void efi_retrieve_tpm2_eventlog(void)
* Figure out whether any events have already been logged to the
* final events structure, and if so how much space they take up
*/
- final_events_table = get_efi_config_table(LINUX_EFI_TPM_FINAL_LOG_GUID);
+ if (version == EFI_TCG2_EVENT_LOG_FORMAT_TCG_2)
+ final_events_table = get_efi_config_table(LINUX_EFI_TPM_FINAL_LOG_GUID);
if (final_events_table && final_events_table->nr_events) {
struct tcg_pcr_event2_head *header;
int offset;