aboutsummaryrefslogtreecommitdiff
path: root/src/image
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2014-07-30 16:16:10 +0100
committerMichael Brown <mcb30@ipxe.org>2014-07-30 16:16:10 +0100
commit79419a1c69c13c854148021ce4203c0dd6908b2a (patch)
tree9d3fc2c949266c542e360b55b01a3317e2b19548 /src/image
parentb53d4ae398e74846a6590fc48c295f319397e9c1 (diff)
downloadipxe-79419a1c69c13c854148021ce4203c0dd6908b2a.zip
ipxe-79419a1c69c13c854148021ce4203c0dd6908b2a.tar.gz
ipxe-79419a1c69c13c854148021ce4203c0dd6908b2a.tar.bz2
[efi] Fill in loaded image's DeviceHandle if firmware fails to do so
Some EFI 1.10 implementations (observed with a mid-2011 iMac) seem to fail to fill in the DeviceHandle for our loaded images. It is plausible that these implementations fill in the DeviceHandle only if loading the image from a device path (rather than directly from a memory buffer). Work around this problem by filling in DeviceHandle if the firmware leaves it empty. We cannot sensibly fill in FilePath, because we have no way of knowing whether or not the firmware will treat this as a pointer to be freed when the image returns. Reported-by: Curtis Larsen <larsen@dixie.edu> Tested-by: Curtis Larsen <larsen@dixie.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/efi_image.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/image/efi_image.c b/src/image/efi_image.c
index 51805c9..02ff8b2 100644
--- a/src/image/efi_image.c
+++ b/src/image/efi_image.c
@@ -209,6 +209,13 @@ static int efi_image_exec ( struct image *image ) {
goto err_open_protocol;
}
+ /* Some EFI 1.10 implementations seem not to fill in DeviceHandle */
+ if ( loaded.image->DeviceHandle == NULL ) {
+ DBGC ( image, "EFIIMAGE %p filling in missing DeviceHandle\n",
+ image );
+ loaded.image->DeviceHandle = snpdev->handle;
+ }
+
/* Sanity checks */
assert ( loaded.image->ParentHandle == efi_image_handle );
assert ( loaded.image->DeviceHandle == snpdev->handle );