Skip to content

Commit

Permalink
pcrlock: ignore empty device path
Browse files Browse the repository at this point in the history
Don't mark records with empty device path as invalid. When shim is in
use such records are normal :-/
rhboot/shim#642
  • Loading branch information
lnussel committed Apr 4, 2024
1 parent aff0941 commit b241137
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pcrlock/pcrlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,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;

Expand Down

0 comments on commit b241137

Please sign in to comment.