opengnsys_ipxe/src
Michael Brown 18d2162f64 [efi] Work around UEFI specification bug in LoadImage
iPXE currently assumes that any error returned from LoadImage()
indicates that the image was not loaded.  This assumption was correct
at the time the code was written and remained correct for UEFI
specifications up to and including version 2.1.

In version 2.3, the UEFI specification broke API and ABI compatibility
by defining that a return value of EFI_SECURITY_VIOLATION would now
indicate that the image had been loaded and a valid image handle had
been created, but that the image should not be started.

The wording in version 2.2 is ambiguous, and does not define whether
or not a return value of EFI_SECURITY_VIOLATION indicates that a valid
image handle has been created.

Attempt to work around all of these incompatible and partially
undefined APIs by calling UnloadImage if we get a return value of
EFI_SECURITY_VIOLATION.  Minimise the risk of passing an uninitialised
pointer to UnloadImage by setting ImageHandle to NULL prior to calling
LoadImage.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2020-06-04 22:40:35 +01:00
..
arch [int13con] Create log partition only when CONSOLE_INT13 is enabled 2020-03-01 12:59:03 +00:00
bin
config [build] Add named configuration for Raspberry Pi 2019-07-19 17:45:22 +01:00
core [settings] Eliminate variable-length stack allocation 2020-02-16 22:30:38 +00:00
crypto [crypto] Profile the various stages of modular multiplication 2019-08-17 01:24:51 +01:00
doc [build] Rename gPXE to iPXE 2010-04-19 23:43:39 +01:00
drivers [bnxt] Add driver support for Broadcom NetXtreme-E Adapters 2020-05-06 15:41:45 +01:00
hci [init] Show startup and shutdown function names in debug messages 2019-01-25 14:53:43 +00:00
image [efi] Work around UEFI specification bug in LoadImage 2020-06-04 22:40:35 +01:00
include [peerdist] Limit number of concurrent raw block downloads 2019-08-16 22:19:50 +01:00
interface [efi] Disambiguate errors returned by ConnectController 2020-03-14 09:49:49 +00:00
libgcc [libgcc] Provide __divmoddi4() 2016-05-05 23:42:57 +01:00
net [iscsi] Eliminate variable-length stack allocation in URI parsing 2020-02-16 23:47:06 +00:00
scripts [efi] Centralise architecture-independent EFI Makefile and linker script 2016-03-12 21:47:13 +00:00
tests [libc] Fix strcmp()/strncmp() to return proper values 2019-01-15 14:12:27 +00:00
usr [image] Omit URI query string and fragment from download progress messages 2017-12-28 13:42:44 +00:00
util [build] Do not apply WORKAROUND_CFLAGS for host compiler 2019-07-22 14:51:28 +01:00
.gitignore [build] Add support for local configuration files 2010-03-26 19:07:22 +00:00
Makefile [bnxt] Add driver support for Broadcom NetXtreme-E Adapters 2020-05-06 15:41:45 +01:00
Makefile.efi [efi] Centralise architecture-independent EFI Makefile and linker script 2016-03-12 21:47:13 +00:00
Makefile.housekeeping [build] Move predefined all-drivers build shortcut to Makefile 2019-08-02 11:00:43 +01:00
doxygen.cfg [build] Remove PACKED macro 2010-05-29 23:49:47 +01:00