[PATCH] efi: loader: accept NULL DevicePath in LoadImage when SourceBuffer is given
Sascha Hauer
s.hauer at pengutronix.de
Fri Aug 28 05:14:32 PDT 2026
On Wed, 26 Aug 2026 13:45:01 +0200, Ahmad Fatoum wrote:
> The UEFI specification only requires DevicePath when no SourceBuffer is
> given. Loading an image from memory with a NULL DevicePath is valid and
> results in a loaded image without device handle and file path. That's what
> EDK2 does and what the U-Boot code this was imported from does as well, as
> it ignores the result of efi_dp_split_file_path().
>
> barebox on the other hand checks the result and as efi_dp_dup(NULL) returns
> NULL, LoadImage fails with the misleading EFI_OUT_OF_RESOURCES. This breaks
> chainloading from a barebox EFI payload running on top of the barebox EFI
> loader: the payload passes the device path of its own device handle, which
> it doesn't have when it was booted via QEMU's fw_cfg, so it passes NULL.
>
> [...]
Applied, thanks!
[1/1] efi: loader: accept NULL DevicePath in LoadImage when SourceBuffer is given
https://git.pengutronix.de/cgit/barebox/commit/?id=5e86781197ad (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer at pengutronix.de>
More information about the barebox
mailing list