[tip: x86/urgent] x86/Kconfig: Enable ROX also when STRICT_KERNEL_RWX is present
From: tip-bot2 for Richard Weinberger
Date: Sat Nov 21 2026 - 14:22:23 EST
The following commit has been merged into the x86/urgent branch of tip:
Commit-ID: ae3398a7da224e1cb14a04ce8e9da66fc2948121
Gitweb: https://git.kernel.org/tip/ae3398a7da224e1cb14a04ce8e9da66fc2948121
Author: Richard Weinberger <richard@xxxxxx>
AuthorDate: Thu, 25 Jun 2026 11:06:27 +02:00
Committer: Borislav Petkov (AMD) <bp@xxxxxxxxx>
CommitterDate: Sat, 21 Nov 2026 11:06:09 -08:00
x86/Kconfig: Enable ROX also when STRICT_KERNEL_RWX is present
Running a kernel with CONFIG_MODULES=n causes the W+X page detection
to trigger:
x86/mm: Found insecure W+X mapping at address 0xffffffffc033a000
The W+X pages come from __its_alloc() with type being EXECMEM_MODULE_TEXT.
Without ARCH_HAS_EXECMEM_ROX pgprot is PAGE_KERNEL instead of PAGE_KERNEL_ROX.
Fixes: 47410d839fcda ("x86/Kconfig: only enable ROX cache in execmem when STRICT_MODULE_RWX is set")
Suggested-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Signed-off-by: Richard Weinberger <richard@xxxxxx>
Signed-off-by: Borislav Petkov (AMD) <bp@xxxxxxxxx>
Acked-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Acked-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
Tested-by: Vinny Horgan <vinnyhorgan@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx
Link: https://patch.msgid.link/20260625090627.1501095-1-richard@xxxxxx
---
arch/x86/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 58dce0b..3159852 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -84,7 +84,7 @@ config X86
select ARCH_HAS_DMA_OPS if GART_IOMMU || XEN
select ARCH_HAS_EARLY_DEBUG if KGDB
select ARCH_HAS_ELF_RANDOMIZE
- select ARCH_HAS_EXECMEM_ROX if X86_64 && STRICT_MODULE_RWX
+ select ARCH_HAS_EXECMEM_ROX if X86_64 && (STRICT_MODULE_RWX || STRICT_KERNEL_RWX)
select ARCH_HAS_FAST_MULTIPLIER
select ARCH_HAS_FORTIFY_SOURCE
select ARCH_HAS_GCOV_PROFILE_ALL