efi_loader: Assure fitImage from capsule is used from 8-byte aligned address
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Thu, 13 Nov 2025 11:55:49 +0000 (12:55 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 15 Nov 2025 10:50:42 +0000 (11:50 +0100)
commit8cc144227e13b50cd6d97c36ebb45f31f4d8c9cd
treecfc07f8e8391709e7c52c525253410dc78d4dba6
parentb8f2614ecaca83b381a92af54e5e38eefaf7646f
efi_loader: Assure fitImage from capsule is used from 8-byte aligned address

The fitImage may be stored in EFI update capsule at address that
is not aligned to 8 bytes. Since fitImage is a DT, new version of
libfdt 1.7.2 rejects such an unaligned DT. Patch the code and copy
the fitImage into aligned buffer in case it is not aligned. This
does increase overhead for unaligned fitImages in EFI capsules, but
tries to keep the overhead low for aligned ones.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_firmware.c