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 Mar 7, 2024
1 parent d6fdb51 commit 751b17e
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 @@ -777,6 +777,16 @@ static int event_log_record_extract_firmware_description(EventLogRecord *rec) {
const packed_EFI_DEVICE_PATH *dp = (const packed_EFI_DEVICE_PATH*) load->devicePath;
size_t left = load->lengthOfDevicePath;

/* 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 (left == 0) {
rec->description = strdup("File:");
if (!rec->description)
return log_oom();

return 1;
}

for (;;) {
if (left == 0) {
if (!end) {
Expand Down

0 comments on commit 751b17e

Please sign in to comment.