modules: Remove #ifdef CONFIG_STRICT_MODULE_RWX around rodata_enabled
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Thu, 21 Dec 2023 09:02:47 +0000 (10:02 +0100)
committerLuis Chamberlain <mcgrof@kernel.org>
Fri, 2 Feb 2024 18:21:25 +0000 (10:21 -0800)
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>
kernel/module/strict_rwx.c

index 9b2d58a8d59d3293d2c74167f9098341058e5929..b36d93983465c62cfcf4838b430a0f92e855119f 100644 (file)
@@ -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);