mbox series

[v2,0/6] arm64/efi/zboot: Clean up and enable BTI annotation

Message ID 20230418134952.1170141-1-ardb@kernel.org (mailing list archive)
Headers show
Series arm64/efi/zboot: Clean up and enable BTI annotation | expand

Message

Ard Biesheuvel April 18, 2023, 1:49 p.m. UTC
Some tweaks for the arm64 EFI header and the zboot version, to add the
annotation that informs the loader that the code regions may be mapped
with BTI enforcement enabled.

As a related cleanup, add the combined codesize (text+rodata+inittext)
to the arm64 Image header, so the EFI zboot loader can grab it from the
image after decompressing it.

Changes since v1:
- instead of adding a proper header field, only pass the code size via
  the image header when generating the zboot image, using the
  text_offset field which still has meaning in the bare metal ABI (which
  means bare metal loaders must honour it) but is actually no longer in
  use.

Ard Biesheuvel (6):
  efi/pe: Import new BTI/IBT header flags from the spec
  arm64: efi: Enable BTI codegen and add PE/COFF annotation
  efi/zboot: arm64: Poke kernel code size into the zboot payload image
    header
  efi/zboot: Add BSS padding before compression
  efi/zboot: Set forward edge CFI compat header flag if supported
  efi/zboot: arm64: Grab code size from image header

 arch/arm64/boot/Makefile                    | 24 ++++++-
 arch/arm64/kernel/efi-header.S              | 71 ++++++++++++--------
 arch/arm64/kernel/image-vars.h              |  4 ++
 drivers/firmware/efi/libstub/Makefile       |  3 +-
 drivers/firmware/efi/libstub/Makefile.zboot | 41 +++++++----
 drivers/firmware/efi/libstub/arm64.c        | 26 +++++--
 drivers/firmware/efi/libstub/efistub.h      |  3 +-
 drivers/firmware/efi/libstub/zboot-header.S | 51 +++++++++-----
 drivers/firmware/efi/libstub/zboot.c        | 13 +---
 include/linux/pe.h                          |  4 ++
 10 files changed, 160 insertions(+), 80 deletions(-)