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

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

From: Christophe Leroy <hidden>
Date: 2022-02-03 18:01:27
Also in: linux-modules, lkml


Le 03/02/2022 à 01:20, Luis Chamberlain a écrit :
On Sun, Jan 30, 2022 at 09:32:01PM +0000, Aaron Tomlin wrote:
quoted
Hi Luis,

As per your suggestion [1], this is an attempt to refactor and split
optional code out of core module support code into separate components.
This version is based on branch mcgrof/modules-next since a97ac8cb24a3/or
modules-5.17-rc1. Please let me know your thoughts.

Changes since v1 [2]:
I have another comment: I think patch 5 should be dropped.

Having something behave based on a CONFIG_ARCH_HAS_SOMETHING item is 
wrong. It is not because a plateform selects 
CONFIG_ARCH_HAS_STRICT_MODULE_RWX that the module core should behave 
differentely than with other platforms as far as the user has not 
selected CONFIG_STRICT_MODULE_RWX.

And the topic here is wrong. It is a coincidence if making that stuff 
depend on CONFIG_ARCH_HAS_STRICT_MODULE_RWX works. This is just because 
the only architectures that do the module allocation without Exec flag 
are architectures that have also selected 
CONFIG_ARCH_HAS_STRICT_MODULE_RWX. But it should also work on other 
architectures.

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.

module_enable_x() should work just fine regardless of 
CONFIG_ARCH_HAS_STRICT_MODULE_RWX.

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