On Sat, Oct 03, 2026 at 06:40:04AM +0100, Simon Glass wrote:
> Hi Vincent,
> 
> On 2026-10-02T08:37:46, Vincent Stehlé <[email protected]> wrote:
> > efi_selftest: add minimal fmp test
> >
> > Add a minimal test for the UEFI Firmware Management Protocol.
> > At this point the test only does the following:
> >
> > For all handles in the system with FMP,
> > - Get current firmware images info.
> > - For each image, verify consistency of the flags, with some attention to
> >   authentication.
> >
> > This can be tested on the sandbox with the following command:
> >
> >   ./u-boot -T -c "setenv efi_selftest firmware management protocol; \
> >                   bootefi selftest"
> >
> > Testing with multiple handles supporting FMP can be done by enabling
> > both CONFIG_EFI_CAPSULE_FIRMWARE_FIT and
> > CONFIG_EFI_CAPSULE_FIRMWARE_RAW.
> >
> > Signed-off-by: Vincent Stehlé <[email protected]>
> > [...]
> >
> > lib/efi_selftest/Makefile           |   2 +
> >  lib/efi_selftest/efi_selftest_fmp.c | 240 
> > ++++++++++++++++++++++++++++++++++++
> >  2 files changed, 242 insertions(+)
> 
> > diff --git a/lib/efi_selftest/efi_selftest_fmp.c 
> > b/lib/efi_selftest/efi_selftest_fmp.c
> > @@ -0,0 +1,240 @@
> > +     if (desc_size < sizeof(struct efi_firmware_image_descriptor) ||
> > +         __builtin_mul_overflow(desc_size, desc_cnt, &total_size) ||
> > +         total_size > img_info_size) {
> 
> Please can you use check_mul_overflow() from <linux/overflow.h> rather
> than the builtin? Nothing else in lib/efi_selftest or lib/efi_loader
> uses the builtin directly.

Importing that header first and making use of it more widely second
would be a reasonable thing for a backlog / TODO list for someone. As
Rasmus is the original author in Linux, it might even be on his list
somewhere (along with re-syncing the related compiler header parts).

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to