]> git.ipfire.org Git - thirdparty/systemd.git/commit
boot: fix buffer alignment when doing block I/O (#40465)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 16 Feb 2026 00:10:01 +0000 (09:10 +0900)
committerGitHub <noreply@github.com>
Mon, 16 Feb 2026 00:10:01 +0000 (09:10 +0900)
commit6d0e8271b4ab332d356d7f59394035da2d8845a8
tree508b4d0ec2d2649cf1abe557404b8cbce4f66e75
parent4afa6cf07a8ce3e281b2ae031e225835740294a9
parentccbd324a3a522362de0863e8d06cdd06a58d2fca
boot: fix buffer alignment when doing block I/O (#40465)

UEFI Block I/O Protocol has `Media->IoAlign` field dictating the minimum
alignment for I/O buffer. It's quite surprising this has been lingering
here unnoticed for years, seems like most UEFI implementations have
small or no alignment requirements. U-Boot is not the case here, and
requires at least 512 byte alignment, hence attempt to read GPT
partition table fail and in effect systemd-boot can not find XBOOTLDR
partition.

These patches allow to boot from XBOOTLDR partition on U-Boot - tested
with latest systemd revision and U-Boot master
(`8de6e8f8a076d2c9b6d38d8563db135c167077ec`) on x64 and ARM32, of which
both are failing without the patch.

Also fixes Bitlocker probing logic, which is the only other place where
raw block I/O is used, however this is untested.
src/boot/boot.c