]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Skip interface uninstallation during shutdown
authorMichael Brown <mcb30@ipxe.org>
Thu, 17 Dec 2020 20:37:27 +0000 (20:37 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 17 Dec 2020 21:32:49 +0000 (21:32 +0000)
commit6769a7c3c669cbb0455c7d83a3257c4582cf683d
treed2fe6e941df207b447fb823923e1d35bf08af10c
parentfb91542f2a4a593955b620d514b0c0bd9d7af8cd
[efi] Skip interface uninstallation during shutdown

iPXE seems to be almost alone in the UEFI world in attempting to shut
down cleanly, free resources, and leave hardware in a well-defined
reset state before handing over to the booted operating system.

The UEFI driver model does allow for graceful shutdown via
uninstallation of protocol interfaces.  However, virtually no other
UEFI drivers do this, and the external code paths that react to
uninstallation are consequently poorly tested.  This leads to a
proliferation of bugs found in UEFI implementations in the wild, as
described in commits such as 1295b4a ("[efi] Allow initialisation via
SNP interface even while claimed") or b6e2ea0 ("[efi] Veto the HP
XhciDxe Driver").

Try to avoid triggering such bugs by unconditionally skipping the
protocol interface uninstallation during UEFI boot services shutdown,
leaving the interfaces present but nullified and deliberately leaking
the containing memory.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/efi/efi_block.c
src/interface/efi/efi_pxe.c
src/interface/efi/efi_snp.c
src/interface/efi/efi_snp_hii.c