summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/header.S
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2022-03-29 20:47:43 +0200
committerArd Biesheuvel <ardb@kernel.org>2022-05-03 15:31:28 +0200
commit24b72bb12e84c75e297a5a81f24b921d7a011575 (patch)
tree449d19a8328f6cb851f61867fc3d3f9cf70ea4c3 /arch/x86/boot/header.S
parentefi: libstub: ensure allocated memory to be executable (diff)
downloadlinux-24b72bb12e84c75e297a5a81f24b921d7a011575.tar.xz
linux-24b72bb12e84c75e297a5a81f24b921d7a011575.zip
efi: x86: Set the NX-compatibility flag in the PE header
Following Baskov Evgeniy's "Handle UEFI NX-restricted page tables" patches, it's safe to set this compatibility flag to let loaders know they don't need to make special accommodations for kernel to load if pre-boot NX is enabled. Signed-off-by: Peter Jones <pjones@redhat.com> Link: https://lore.kernel.org/all/20220329184743.798513-1-pjones@redhat.com/ Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'arch/x86/boot/header.S')
-rw-r--r--arch/x86/boot/header.S4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index 6dbd7e9f74c9..0352e4589efa 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -163,7 +163,11 @@ extra_header_fields:
.long 0x200 # SizeOfHeaders
.long 0 # CheckSum
.word IMAGE_SUBSYSTEM_EFI_APPLICATION # Subsystem (EFI application)
+#ifdef CONFIG_DXE_MEM_ATTRIBUTES
+ .word IMAGE_DLL_CHARACTERISTICS_NX_COMPAT # DllCharacteristics
+#else
.word 0 # DllCharacteristics
+#endif
#ifdef CONFIG_X86_32
.long 0 # SizeOfStackReserve
.long 0 # SizeOfStackCommit