Thread (39 messages) 39 messages, 8 authors, 2022-02-09

Re: [RFC PATCH v4 00/13] module: core code clean up

From: Aaron Tomlin <atomlin@atomlin.com>
Date: 2022-02-07 17:00:33
Also in: linux-modules, lkml

On Thu 2022-02-03 18:01 +0000, Christophe Leroy wrote:
I don't know exactly what was the motivation for commit 93651f80dcb6 
("modules: fix compile error if don't have strict module rwx") at the 
first place but it is just wrong and we should fix it.
Christophe,

I think we are in agreement. If I understand correctly, it should not be
possible to enable CONFIG_STRICT_MODULE_RWX without
CONFIG_ARCH_HAS_STRICT_MODULE_RWX (or inversely), as per arch/Kconfig:

  config STRICT_MODULE_RWX
	  bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
	  depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
	  default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT

The objective of Linus' commit ad21fc4faa2a1 ("arch: Move
CONFIG_DEBUG_RODATA and CONFIG_SET_MODULE_RONX to be common") and in
particular commit 0f5bf6d0afe4b ("arch: Rename CONFIG_DEBUG_RODATA and
CONFIG_DEBUG_MODULE_RONX") does seem correct. So, architectures that would
prefer to make this feature selectable rather than enabled by default
should continue to have this option.
module_enable_x() should work just fine regardless of 
CONFIG_ARCH_HAS_STRICT_MODULE_RWX.
As per the above, we should fix commit 93651f80dcb6 ("modules: fix compile
error if don't have strict module rwx") so a stub for module_enable_x()
would no longer be required, right?


Kind regards,

-- 
Aaron Tomlin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help