mbox series

[0/2] efi: Allow initrd LoadFile2 proto on loaded image

Message ID 20230310084529.3229983-1-ardb@kernel.org
Headers show
Series efi: Allow initrd LoadFile2 proto on loaded image | expand

Message

Ard Biesheuvel March 10, 2023, 8:45 a.m. UTC
Rework the code that loads the initrd via LoadFile2 so that it looks for
the protocol on the loaded image handle first, and only if it doesn't
find it here, on the global singleton device path. This works around
reported issues where intermediate loader stages are providing an initrd
via this mechanism, and subsequently loading another intermediate boot
stage that does the same.

Link: https://github.com/systemd/systemd/issues/26723

Cc: Michael Brown <mcb30@ipxe.org>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>

Ard Biesheuvel (2):
  efi: libstub: Pass loaded image EFI handle to efi_load_initrd()
  efi: libstub: Look for initrd LoadFile2 protocol on image handle

 drivers/firmware/efi/libstub/efi-stub-helper.c | 45 ++++++++++++--------
 drivers/firmware/efi/libstub/efi-stub.c        |  4 +-
 drivers/firmware/efi/libstub/efistub.h         |  3 +-
 drivers/firmware/efi/libstub/x86-stub.c        |  4 +-
 include/linux/efi.h                            |  2 +-
 include/linux/pe.h                             |  2 +-
 6 files changed, 36 insertions(+), 24 deletions(-)