mbox series

[0/2] arm64: efi: Robustify EFI runtime wrapper code

Message ID 20221205201210.463781-1-ardb@kernel.org
Headers show
Series arm64: efi: Robustify EFI runtime wrapper code | expand

Message

Ard Biesheuvel Dec. 5, 2022, 8:12 p.m. UTC
Make the EFI runtime wrapper code more robust, by switching to a
dedicated stack and dealing with sync exceptions occurring in firmware
by unwinding it. While at it, move the backup copy of register X18 onto
the base of that stack too so we can can restore it if needed without
reloading it from the ordinary stack.

Patch #2 is a v2 of a patch that got merged and reverted again in
v6.1-rc.

This supersedes 'arm64: efi: Move runtime services asm wrapper out of
.text'

Cc: Sami Tolvanen <samitolvanen@google.com>
Cc: Kees Cook <keescook@chromium.org>

Ard Biesheuvel (2):
  arm64: efi: Execute runtime services from a dedicated stack
  arm64: efi: Recover from synchronous exceptions occurring in firmware

 arch/arm64/include/asm/efi.h            | 11 +++++
 arch/arm64/kernel/efi-rt-wrapper.S      | 38 ++++++++++++++--
 arch/arm64/kernel/efi.c                 | 47 ++++++++++++++++++++
 arch/arm64/mm/fault.c                   |  4 ++
 drivers/firmware/efi/runtime-wrappers.c |  1 +
 5 files changed, 98 insertions(+), 3 deletions(-)