lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20260115023456.621586-2-junan76@163.com>
Date: Thu, 15 Jan 2026 10:34:18 +0800
From: junan <junan76@....com>
To: catalin.marinas@....com,
	will@...nel.org
Cc: linux-arm-kernel@...ts.infradead.org,
	linux-kernel@...r.kernel.org,
	oe-kbuild-all@...ts.linux.dev,
	junan76@....com,
	kernel test robot <lkp@...el.com>
Subject: [PATCH v2] arm64: kconfig: Make STRICT_KERNEL_RWX visable.

Make "STRICT_KERNEL_RWX" visable to menuconfig on arm64 platform.

Breakpoints can not be set when using kgdb/kdb if "STRICT_KERNEL_RWX"
equals to "y", but it has a default value "y" and is not visable in
menuconfig on arm64.

Link to kgdb/kdb doc: https://docs.kernel.org/process/debugging/kgdb.html

Changes in v2:
	- Fix link error of "rodata_enabled" when allnoconfig is set
	- link to v1: https://lore.kernel.org/linux-arm-kernel/20260114013859.498148-2-junan76@163.com/

Signed-off-by: junan <junan76@....com>
Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601141630.sCPCgSYw-lkp@intel.com/
---
 arch/arm64/Kconfig  | 2 ++
 arch/arm64/mm/mmu.c | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index 93173f0a09c7..cc3aaffa1e12 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -52,6 +52,8 @@ config ARM64
 	select ARCH_STACKWALK
 	select ARCH_HAS_STRICT_KERNEL_RWX
 	select ARCH_HAS_STRICT_MODULE_RWX
+	select ARCH_OPTIONAL_KERNEL_RWX		if ARCH_HAS_STRICT_KERNEL_RWX
+	select ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
 	select ARCH_HAS_SYNC_DMA_FOR_DEVICE
 	select ARCH_HAS_SYNC_DMA_FOR_CPU
 	select ARCH_HAS_SYSCALL_WRAPPER
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 8e1d80a7033e..4770204d9e22 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -1314,7 +1314,11 @@ void __init kpti_install_ng_mappings(void)
 
 static pgprot_t __init kernel_exec_prot(void)
 {
+#if defined(CONFIG_STRICT_KERNEL_RWX) || defined(CONFIG_STRICT_MODULE_RWX)
 	return rodata_enabled ? PAGE_KERNEL_ROX : PAGE_KERNEL_EXEC;
+#else
+	return PAGE_KERNEL_EXEC;
+#endif
 }
 
 static int __init map_entry_trampoline(void)
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ