]> git.ipfire.org Git - thirdparty/systemd.git/commit
efi-api: fix unaligned access in efi_guid_to_id128()
authorDaan De Meyer <daan@amutable.com>
Thu, 21 May 2026 22:00:28 +0000 (22:00 +0000)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 May 2026 08:25:50 +0000 (10:25 +0200)
commit24319a9c2cd392df38819ecc7cb235d384445fcb
tree883d37feb4272538b1b9e5b2131630680187b64e
parentb45a897edc1a11b8cf2f876f00dbb73f82fe5b6a
efi-api: fix unaligned access in efi_guid_to_id128()

EFI_GUID requires 4-byte alignment due to its uint32_t Data1 field, but
callers may pass pointers at arbitrary offsets into serialized EFI
variable buffers (e.g. bootctl walking BootXXXX entries). UBSan flagged
the misaligned member access; the old comment claiming the struct was
packed was wrong. Copy the bytes into an aligned local first.

Co-developed-by: Claude Opus 4.7 <noreply@anthropic.com>
src/shared/efi-api.c