efi: zboot: Use EFI protocol to remap code/data with the right attributes
authorArd Biesheuvel <ardb@kernel.org>
Mon, 30 Jan 2023 12:11:53 +0000 (13:11 +0100)
committerArd Biesheuvel <ardb@kernel.org>
Fri, 3 Feb 2023 15:39:22 +0000 (16:39 +0100)
commitace013a543067ed33cf593144b18c6dbeb517cee
treee8ac02270bc42999f408249ffe7f748f730473ff
parent79729f26b074a5d2722c27fa76cc45ef721e65cd
efi: zboot: Use EFI protocol to remap code/data with the right attributes

Use the recently introduced EFI_MEMORY_ATTRIBUTES_PROTOCOL in the zboot
implementation to set the right attributes for the code and data
sections of the decompressed image, i.e., EFI_MEMORY_RO for code and
EFI_MEMORY_XP for data.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/libstub/efi-stub-helper.c
drivers/firmware/efi/libstub/efistub.h
drivers/firmware/efi/libstub/zboot.c