pcrlock: ignore empty device path

Don't mark records with empty device path as invalid. When shim is in
use such records are normal :-/
https://github.com/rhboot/shim/issues/642
This commit is contained in:
Ludwig Nussel
2026-08-04 14:11:43 -07:00
committed by Akarithos
parent 230f171837
commit 2e7c9a24a1
+10
View File
@@ -830,6 +830,16 @@ static int event_log_record_extract_firmware_description(EventLogRecord *rec) {
goto invalid;
}
/* device path could be empty. Don't mark that as invalid but leave as don't know.
* Happens eg with shim https://github.com/rhboot/shim/issues/642 */
if (load->lengthOfDevicePath == 0) {
rec->description = strdup("File: <unspecified>");
if (!rec->description)
return log_oom();
return 1;
}
const packed_EFI_DEVICE_PATH *dp = (const packed_EFI_DEVICE_PATH*) load->devicePath;
size_t left = load->lengthOfDevicePath;