Skip to content

Commit d41373a

Browse files
xypronpalmer-dabbelt
authored andcommitted
riscv: efi: Set NX compat flag in PE/COFF header
The IMAGE_DLLCHARACTERISTICS_NX_COMPAT informs the firmware that the EFI binary does not rely on pages that are both executable and writable. The flag is used by some distro versions of GRUB to decide if the EFI binary may be executed. As the Linux kernel neither has RWX sections nor needs RWX pages for relocation we should set the flag. Cc: Ard Biesheuvel <[email protected]> Cc: <[email protected]> Signed-off-by: Heinrich Schuchardt <[email protected]> Reviewed-by: Emil Renner Berthing <[email protected]> Fixes: cb7d2dd ("RISC-V: Add PE/COFF header for EFI stub") Acked-by: Ard Biesheuvel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 33549fc commit d41373a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/riscv/kernel/efi-header.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extra_header_fields:
6464
.long efi_header_end - _start // SizeOfHeaders
6565
.long 0 // CheckSum
6666
.short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem
67-
.short 0 // DllCharacteristics
67+
.short IMAGE_DLL_CHARACTERISTICS_NX_COMPAT // DllCharacteristics
6868
.quad 0 // SizeOfStackReserve
6969
.quad 0 // SizeOfStackCommit
7070
.quad 0 // SizeOfHeapReserve

0 commit comments

Comments
 (0)