From ac3d8922df1a08de934fc9d8c81cd0215bcb1633 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Thu, 16 Feb 2023 15:24:44 +0100 Subject: [PATCH] boot: Fix assertion failure The TPM code expects a description unless the PCR index indicates that no measurements have to take place. The assert was preempting this check from happening. Fixes: #26428 (cherry picked from commit f92428eae53685f372775e8cb0f0f4c249f02724) (cherry picked from commit cd5de2811ae72e209377f714cdbd8e5a0d6361bc) --- src/boot/efi/measure.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/efi/measure.c b/src/boot/efi/measure.c index 6da07d917e..0b5b626700 100644 --- a/src/boot/efi/measure.c +++ b/src/boot/efi/measure.c @@ -146,7 +146,7 @@ EFI_STATUS tpm_log_event(uint32_t pcrindex, EFI_PHYSICAL_ADDRESS buffer, UINTN b EFI_TCG2 *tpm2; EFI_STATUS err; - assert(description); + assert(description || pcrindex == UINT32_MAX); /* If EFI_SUCCESS is returned, will initialize ret_measured to true if we actually measured * something, or false if measurement was turned off. */