You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Boot an x86_64 system from an iPXE USB image under UEFI Secure Boot.
Let iPXE download and attempt to boot a network image.
Return to the firmware/BIOS environment (for example, by using a returnable image path or another method that makes iPXE hand control back to the firmware).
Launch the UEFI shell from there.
Run the dh command.
The system hangs.
Root Cause
The iPXE shim uses the shim loader path from rhboot/shim, which hooks LoadImage(), StartImage(), and UnloadImage() in the EFI Boot Services table when Secure Boot is enabled.
In loader-proto.c, shim_load_image() installs LoadedImage, LoadedImageDevicePath, and SHIM_LOADED_IMAGE_GUID on a newly created image handle via InstallMultipleProtocolInterfaces(ImageHandle, ...).
On the error cleanup path, the code calls UninstallMultipleProtocolInterfaces(ImageHandle, ...) instead of UninstallMultipleProtocolInterfaces(*ImageHandle, ...).
As a result, the installed protocols are not properly uninstalled, and the image handle is leaked.
Also Found
The iPXE boot flow uses the following image lifecycle sequence: efi_image_probe() -> LoadImage() -> UnloadImage() -> efi_image_exec() -> LoadImage() -> StartImage(). See ipxe/src/image/efi_image.c for details
When Secure Boot is enabled, the shim loader hooks these EFI Boot Services calls, which is where the issue is exposed.
The first UnloadImage() happens before StartImage(), so if cleanup is only expected in shim_start_image(), the first image handle will be leaked.
Additional Debug Observations
Debug logs captured during LoadImage() show the protocol install/uninstall flow in both successful (boot image signed) and failed (boot image not signed) cases. You can find that image handle seems to be leaked in both cases.
Failed case: Success case:
Suggested Solution
Fix the error cleanup in shim_load_image() to uninstall using *ImageHandle.
Remove the protocol uninstall / image free logic from shim_start_image().
The proposed fix has not yet been verified in the current test environment and should be treated as a suggested remediation, not as a confirmed resolution.
This issue is not specific to PXE vs HTTP, nor to a particular hardware platform such as CRB.
Symptom
dhafter booting iPXE under Secure Boot.iPXE version
Firmware Environment
Steps to Reproduce
dhcommand.Root Cause
LoadImage(),StartImage(), andUnloadImage()in the EFI Boot Services table when Secure Boot is enabled.loader-proto.c,shim_load_image()installsLoadedImage,LoadedImageDevicePath, andSHIM_LOADED_IMAGE_GUIDon a newly created image handle viaInstallMultipleProtocolInterfaces(ImageHandle, ...).UninstallMultipleProtocolInterfaces(ImageHandle, ...)instead ofUninstallMultipleProtocolInterfaces(*ImageHandle, ...).Also Found
efi_image_probe()->LoadImage()->UnloadImage()->efi_image_exec()->LoadImage()->StartImage(). See ipxe/src/image/efi_image.c for detailsUnloadImage()happens beforeStartImage(), so if cleanup is only expected inshim_start_image(), the first image handle will be leaked.Additional Debug Observations
Debug logs captured during
LoadImage()show the protocol install/uninstall flow in both successful (boot image signed) and failed (boot image not signed) cases. You can find that image handle seems to be leaked in both cases.Failed case:



Success case:
Suggested Solution
shim_load_image()to uninstall using*ImageHandle.shim_start_image().shim_unload_image().loader-proto-fix.patch
Notes