Skip to content

Commit

Permalink
modules: Remove #ifdef CONFIG_STRICT_MODULE_RWX around rodata_enabled
Browse files Browse the repository at this point in the history
Now that rodata_enabled is declared at all time, the #ifdef
CONFIG_STRICT_MODULE_RWX can be removed.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
  • Loading branch information
Christophe Leroy authored and Luis Chamberlain committed Feb 2, 2024
1 parent 398ec3e commit 315df9c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions kernel/module/strict_rwx.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,8 @@ void module_enable_text_rox(const struct module *mod)

void module_enable_rodata_ro(const struct module *mod, bool after_init)
{
if (!IS_ENABLED(CONFIG_STRICT_MODULE_RWX))
return;
#ifdef CONFIG_STRICT_MODULE_RWX
if (!rodata_enabled)
if (!IS_ENABLED(CONFIG_STRICT_MODULE_RWX) || !rodata_enabled)
return;
#endif

module_set_memory(mod, MOD_RODATA, set_memory_ro);
module_set_memory(mod, MOD_INIT_RODATA, set_memory_ro);
Expand Down

0 comments on commit 315df9c

Please sign in to comment.