summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2023-03-10 12:55:41 +0100
committerArd Biesheuvel <ardb@kernel.org>2023-03-10 14:11:39 +0100
commit3c60f67b4bd1bc01fa9194e9dc925ac6cb56156c (patch)
tree377a57993b5f637faf3819fd24411ec5d78d42fb /drivers/firmware
parentefi/libstub: zboot: Mark zboot EFI application as NX compatible (diff)
downloadlinux-3c60f67b4bd1bc01fa9194e9dc925ac6cb56156c.tar.xz
linux-3c60f67b4bd1bc01fa9194e9dc925ac6cb56156c.zip
efi/libstub: arm64: Remap relocated image with strict permissions
After relocating the executable image, use the EFI memory attributes protocol to remap the code and data regions with the appropriate permissions. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/libstub/arm64-stub.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/firmware/efi/libstub/arm64-stub.c b/drivers/firmware/efi/libstub/arm64-stub.c
index d4a6b12a8741..b996553cdb4c 100644
--- a/drivers/firmware/efi/libstub/arm64-stub.c
+++ b/drivers/firmware/efi/libstub/arm64-stub.c
@@ -139,6 +139,7 @@ efi_status_t handle_kernel_image(unsigned long *image_addr,
*image_addr = *reserve_addr;
memcpy((void *)*image_addr, _text, kernel_size);
caches_clean_inval_pou(*image_addr, *image_addr + kernel_codesize);
+ efi_remap_image(*image_addr, *reserve_size, kernel_codesize);
return EFI_SUCCESS;
}