Re: [PATCH 4/8] efi_loader: Correct bounce-buffer setup

Ilias Apalodimas
2025-01-17T10:34:14Z

Hi Simon,

Is this patch for -master of your tree?

On Mon, 6 Jan 2025 at 16:48, Simon Glass <sjg@chromium.org> wrote:
>
> This should set the bounce buffer to a pointer, not an address. Fix it.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> lib/efi_loader/efi_memory.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
> index 2e197e94edd..9374f77d3b7 100644
> --- a/lib/efi_loader/efi_memory.c
> +++ b/lib/efi_loader/efi_memory.c
> @@ -837,11 +837,11 @@ int efi_memory_init(void)
> uint64_t efi_bounce_buffer_addr = 0xffffffff;
>
> if (efi_allocate_pages(EFI_ALLOCATE_MAX_ADDRESS, EFI_BOOT_SERVICES_DATA,
> - (64 * 1024 * 1024) >> EFI_PAGE_SHIFT,
> + SZ_64M >> EFI_PAGE_SHIFT,
> &efi_bounce_buffer_addr) != EFI_SUCCESS)
> return -1;
>
> - efi_bounce_buffer = (void*)(uintptr_t)efi_bounce_buffer_addr;
> + efi_bounce_buffer = map_sysmem(efi_bounce_buffer_addr, SZ_64M);

map_sysmem does *exactly* the same thing so you need to adjust your
commit message.
Does this solve any sandbox crashes?

/Ilias
> #endif
>
> return 0;
> --
> 2.34.1
>