boottime->efi_allocate_pages() returning EFI_NOT_FOUND

Ard Biesheuvel ardb at kernel.org
Thu Mar 13 19:11:01 CET 2025


On Thu, 13 Mar 2025 at 18:27, Ben Schneider <ben at bens.haus> wrote:
>
> Hi Ilias,
>
> On Thursday, March 13th, 2025 at 2:35 AM, Ilias Apalodimas <ilias.apalodimas at linaro.org> wrote:
> >
> > Can you apply https://source.denx.de/u-boot/custodians/u-boot-tpm/-/commit/b04e708c615c15423ffc80d73430bf2d36fb7c21
> > and see if it fixes your problem?
> >
>
> With this patch applied, efi_zboot_entry() appears to proceed to
> __decompress() using target = 0 (first entry on my device), but
> then I get the following messages:
>
> EFI stub: ERROR: EFI decompressor: Out of memory while allocating output buffer
> EFI stub: ERROR: EFI decompressor: Decompression failed
> efi_free_pages: illegal free 0x0, 0x1140
>

Seems like the compression code gets confused by a buffer residing at
memory address 0x0.

Could you try the below please?

--- a/drivers/firmware/efi/libstub/randomalloc.c
+++ b/drivers/firmware/efi/libstub/randomalloc.c
@@ -75,6 +75,9 @@
        if (align < EFI_ALLOC_ALIGN)
                align = EFI_ALLOC_ALIGN;

+       if (alloc_min == 0)
+               alloc_min = align;
+
        size = round_up(size, EFI_ALLOC_ALIGN);

        /* count the suitable slots in each memory map entry */


More information about the U-Boot mailing list