[lkml]   [2020]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: [PATCH] tpm: efi: Don't create binary_bios_measurements file for an empty log
On 2020-10-28 11:30:11, Tyler Hicks wrote:
> So, we need help from Kai, Kenneth, or Mimi to verify my assumption that
> their firmware is providing an empty main event log and a populated
> final event log.

Hi Kai, Kenneth, and Mimi - could one or two of you please follow these

1) Apply the proposed patch in the grandparent of this email so that
your kernel doesn't crash
2) Revert commit 7f3d176f5f7e ("tpm: Require that all digests are
present in TCG_PCR_EVENT2 structures") so that
__calc_tpm2_event_size() goes back to being less picky and may treat
a final log event as a valid event log header
3) Add some debugging warnings in efi_tpm_eventlog_init() to check for
an empty main event log and a populated final event log, as shown
4) Boot the resulting kernel build, look for the warnings, and report

diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index c1955d320fec..c4d2dbd5ed42 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -78,6 +78,9 @@ int __init efi_tpm_eventlog_init(void)
goto out;

+ WARN(!log_tbl->size && final_tbl->nr_events,
+ "nr_events = %llu\n", final_tbl->nr_events);
tbl_size = 0;
if (final_tbl->nr_events != 0) {
void *events = (void *)efi.tpm_final_log
@@ -95,6 +98,8 @@ int __init efi_tpm_eventlog_init(void)
goto out_calc;

+ WARN(!log_tbl->size && tbl_size, "tbl_size = %d\n", tbl_size);
memblock_reserve((unsigned long)final_tbl,
tbl_size + sizeof(*final_tbl));
efi_tpm_final_log_size = tbl_size;
For your convenience, I've created a branch with these changes on top of

Thank you!


 \ /
  Last update: 2020-10-28 23:27    [W:0.156 / U:16.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site