]> git.ipfire.org Git - thirdparty/u-boot.git/commit
efi_loader: fix ecpt size computation
authorVincent Stehlé <vincent.stehle@arm.com>
Thu, 12 Feb 2026 14:40:15 +0000 (15:40 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 15 Feb 2026 07:30:57 +0000 (08:30 +0100)
commitca4eda24c64401eec477c4073e56d136d86f88b0
tree9e7de98eaed85e421b0ca5dd384047c5eeef71ed
parent05b13c05896f43a25f07e01385f156b2142f69aa
efi_loader: fix ecpt size computation

The size of the memory allocated for the EFI Conformance Profiles Table is
computed with `num_entries' always equal to zero, which is incorrect when
CONFIG_EFI_EBBR_2_1_CONFORMANCE is enabled.

This can be verified by allocating the ECPT memory with malloc() instead of
efi_allocate_pool(), building u-boot with sandbox_defconfig and
CONFIG_VALGRIND=y, and by finally running the following command:

  valgrind --suppressions=scripts/u-boot.supp \
    ./u-boot -T -c 'efidebug tables'

Fix this by using an array of the supported profiles GUIDs instead, which
should also be easier to extend in the future as U-Boot should publish the
GUIDs for all supported EBBR revisions.

Fixes: 6b92c1735205 ("efi: Create ECPT table")
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Jose Marinho <jose.marinho@arm.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_conformance.c