Skip to content

Commit

Permalink
module: Remove module_disable_ro()
Browse files Browse the repository at this point in the history
module_disable_ro() has no more users.  Remove it.

Signed-off-by: Josh Poimboeuf <[email protected]>
Acked-by: Peter Zijlstra (Intel) <[email protected]>
Acked-by: Joe Lawrence <[email protected]>
Acked-by: Miroslav Benes <[email protected]>
Acked-by: Jessica Yu <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
jpoimboe authored and Jiri Kosina committed May 7, 2020
1 parent d556e1b commit 0d9fbf7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 15 deletions.
2 changes: 0 additions & 2 deletions include/linux/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -860,10 +860,8 @@ extern int module_sysfs_initialized;

#ifdef CONFIG_STRICT_MODULE_RWX
extern void module_enable_ro(const struct module *mod, bool after_init);
extern void module_disable_ro(const struct module *mod);
#else
static inline void module_enable_ro(const struct module *mod, bool after_init) { }
static inline void module_disable_ro(const struct module *mod) { }
#endif

#ifdef CONFIG_GENERIC_BUG
Expand Down
13 changes: 0 additions & 13 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,19 +1997,6 @@ static void frob_writable_data(const struct module_layout *layout,
(layout->size - layout->ro_after_init_size) >> PAGE_SHIFT);
}

/* livepatching wants to disable read-only so it can frob module. */
void module_disable_ro(const struct module *mod)
{
if (!rodata_enabled)
return;

frob_text(&mod->core_layout, set_memory_rw);
frob_rodata(&mod->core_layout, set_memory_rw);
frob_ro_after_init(&mod->core_layout, set_memory_rw);
frob_text(&mod->init_layout, set_memory_rw);
frob_rodata(&mod->init_layout, set_memory_rw);
}

void module_enable_ro(const struct module *mod, bool after_init)
{
if (!rodata_enabled)
Expand Down

0 comments on commit 0d9fbf7

Please sign in to comment.