@@ -2029,49 +2029,6 @@ static void module_enable_nx(const struct module *mod)
20292029 frob_writable_data (& mod -> init_layout , set_memory_nx );
20302030}
20312031
2032- /* Iterate through all modules and set each module's text as RW */
2033- void set_all_modules_text_rw (void )
2034- {
2035- struct module * mod ;
2036-
2037- if (!rodata_enabled )
2038- return ;
2039-
2040- mutex_lock (& module_mutex );
2041- list_for_each_entry_rcu (mod , & modules , list ) {
2042- if (mod -> state == MODULE_STATE_UNFORMED )
2043- continue ;
2044-
2045- frob_text (& mod -> core_layout , set_memory_rw );
2046- frob_text (& mod -> init_layout , set_memory_rw );
2047- }
2048- mutex_unlock (& module_mutex );
2049- }
2050-
2051- /* Iterate through all modules and set each module's text as RO */
2052- void set_all_modules_text_ro (void )
2053- {
2054- struct module * mod ;
2055-
2056- if (!rodata_enabled )
2057- return ;
2058-
2059- mutex_lock (& module_mutex );
2060- list_for_each_entry_rcu (mod , & modules , list ) {
2061- /*
2062- * Ignore going modules since it's possible that ro
2063- * protection has already been disabled, otherwise we'll
2064- * run into protection faults at module deallocation.
2065- */
2066- if (mod -> state == MODULE_STATE_UNFORMED ||
2067- mod -> state == MODULE_STATE_GOING )
2068- continue ;
2069-
2070- frob_text (& mod -> core_layout , set_memory_ro );
2071- frob_text (& mod -> init_layout , set_memory_ro );
2072- }
2073- mutex_unlock (& module_mutex );
2074- }
20752032#else /* !CONFIG_STRICT_MODULE_RWX */
20762033static void module_enable_nx (const struct module * mod ) { }
20772034#endif /* CONFIG_STRICT_MODULE_RWX */
0 commit comments