david/ipxe
Archived
1
0
This repository has been archived on 2020-12-06. You can view files and clone it, but cannot push or open issues or pull requests.
ipxe/src
Michael Brown 5238c85b62 [efi] Work around broken EFI HII specification
The EFI_HII_CONFIG_ACCESS_PROTOCOL's ExtractConfig() method is passed
a request string which includes the parameters being queried plus an
apparently meaningless blob of information (the ConfigHdr), and is
expected to include this same meaningless blob of information in the
results string.

Neither the specification nor the existing EDK2 code (including the
nominal reference implementation in the DriverSampleDxe driver)
provide any reason for the existence of this meaningless blob of
information.  It appears to be consumed in its entirety by the
EFI_HII_CONFIG_ROUTING_PROTOCOL, and to contain zero bits of
information by the time it reaches an EFI_HII_CONFIG_ACCESS_PROTOCOL
instance.  It would potentially allow for multiple configuration data
sets to be handled by a single EFI_HII_CONFIG_ACCESS_PROTOCOL
instance, in a style alien to the rest of the UEFI specification
(which implicitly assumes that the instance pointer is always
sufficient to uniquely identify the instance).

iPXE currently handles this by simply copying the ConfigHdr from the
request string to the results string, and otherwise ignoring it.  This
approach is also used by some code in EDK2, such as OVMF's PlatformDxe
driver.

As of EDK2 commit 8a45f80 ("MdeModulePkg: Make HII configuration
settings available to OS runtime"), this causes an assertion failure
inside EDK2.  The failure arises when iPXE is handled a NULL request
string, and responds (as per the specification) with a results string
including all settings.  Since there is no meaningless blob to copy
from the request string, there is no corresponding meaningless blob in
the results string.  This now causes an assertion failure in
HiiDatabaseDxe's HiiConfigRoutingExportConfig().

The same failure does not affect the OVMF PlatformDxe driver, which
simply passes the request string to the HII BlockToConfig() utility
function.  The BlockToConfig() function returns EFI_INVALID_PARAMETER
when passed a null request string, and PlatformDxe propagates this
error directly to the caller.

Fix by matching the behaviour of OVMF's PlatformDxe driver: explicitly
return EFI_INVALID_PARAMETER if the request string is NULL or empty.
This violates the specification (insofar as it is feasible to
determine what the specification actually requires), but causes
correct behaviour with the EDK2 codebase.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-04-12 12:24:14 +01:00
..
arch [prefix] Use CRC32 to verify each block prior to decompression 2016-03-24 16:52:26 +00:00
bin Rename .cvsignore files to .gitignore 2007-06-09 22:57:00 +01:00
config [crypto] Allow cross-certificate source to be configured at build time 2016-03-24 19:25:03 +00:00
core [libc] Print "<NULL>" for wide-character NULL strings 2016-04-12 11:53:06 +01:00
crypto [crypto] Allow trusted certificates to be stored in non-volatile options 2016-03-20 17:26:09 +00:00
doc [build] Rename gPXE to iPXE 2010-04-19 23:43:39 +01:00
drivers [qib7322] Validate payload length 2016-03-30 07:31:51 +01:00
hci [infiniband] Add "ibstat" command 2016-03-08 17:38:06 +00:00
image [build] Allow assembler section type character to vary by architecture 2016-03-13 11:20:53 +00:00
include [iscsi] Include DHCP server address in iBFT 2016-03-29 19:38:18 +01:00
interface [efi] Work around broken EFI HII specification 2016-04-12 12:24:14 +01:00
libgcc [build] Mark __intel_new_proc_init with __libgcc rather than cdecl 2009-08-03 15:56:10 +01:00
net [netdevice] Return ENOENT for an unknown bus type 2016-03-29 20:59:30 +01:00
scripts [efi] Centralise architecture-independent EFI Makefile and linker script 2016-03-12 21:47:13 +00:00
tests [libc] Print "<NULL>" for wide-character NULL strings 2016-04-12 11:53:06 +01:00
usr [int13] Allow drive to be hooked using the natural drive number 2016-03-22 09:55:09 +00:00
util [prefix] Use CRC32 to verify each block prior to decompression 2016-03-24 16:52:26 +00:00
.gitignore [build] Add support for local configuration files 2010-03-26 19:07:22 +00:00
doxygen.cfg [build] Remove PACKED macro 2010-05-29 23:49:47 +01:00
Makefile [golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support 2016-03-22 17:55:55 +00:00
Makefile.efi [efi] Centralise architecture-independent EFI Makefile and linker script 2016-03-12 21:47:13 +00:00
Makefile.housekeeping [build] Allow assembler section type character to vary by architecture 2016-03-13 11:20:53 +00:00