Page MenuHomeFreeBSD

efivar: Attempt to fix setting/printing/deleting EFI vars with '-' in their name
ClosedPublic

Authored by imp on Apr 7 2021, 5:59 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 7:17 AM
Unknown Object (File)
Fri, Oct 25, 4:59 PM
Unknown Object (File)
Fri, Oct 25, 4:42 PM
Unknown Object (File)
Oct 18 2024, 11:24 AM
Unknown Object (File)
Oct 9 2024, 11:28 AM
Unknown Object (File)
Oct 2 2024, 9:12 AM
Unknown Object (File)
Sep 30 2024, 3:10 PM
Unknown Object (File)
Sep 29 2024, 8:10 PM
Subscribers
None

Details

Summary

Due to how we're parsing UUIDs, we were disallowing setting, printing or
deleting any UEFI variable with a '-' in it when you attempted to do that
operation with the exact name (wildcard reporting was unaffected). Fix the
parser to loop over all the dashes in the name and only give up when all
possible matches are exhausted.

PR: 251025

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38378
Build 35267: arc lint + arc unit

Event Timeline

imp requested review of this revision.Apr 7 2021, 5:59 AM
imp created this revision.

Better error message with full name.

markj added inline comments.
usr.sbin/efivar/efivar.c
139

If you instead write if (efi_name_to_guid(name, guid) >= 0) break;, you can get rid of the again flag variable.

BTW, efi_name_to_guid(3) is documented as unimplemented. :)

This revision is now accepted and ready to land.Apr 7 2021, 1:24 PM

Address markj's comments

This revision now requires review to proceed.Apr 8 2021, 10:17 PM
This revision is now accepted and ready to land.Apr 9 2021, 1:52 PM