From 95a06095ff3e280f35a69858a69857c1953dfbd3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 22 Jun 2020 17:44:11 +0200 Subject: [PATCH] Revert "module: Make module_enable_ro() static again" This reverts commit e6eff4376e2897c2e14b70d87bf7284cdb093830. It causes a build-breakage on the network test configuration so revert it for now to hopefully add back after -rc2 is merged. Signed-off-by: Greg Kroah-Hartman Change-Id: I866dcc31dc3d3eb68929708d28935c5e13a7fb3d --- include/linux/module.h | 6 ++++++ kernel/module.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/module.h b/include/linux/module.h index b28a9eb76e70..3e2a33b7a66d 100644 --- a/include/linux/module.h +++ b/include/linux/module.h @@ -873,6 +873,12 @@ extern int module_sysfs_initialized; #define __MODULE_STRING(x) __stringify(x) +#ifdef CONFIG_STRICT_MODULE_RWX +extern void module_enable_ro(const struct module *mod, bool after_init); +#else +static inline void module_enable_ro(const struct module *mod, bool after_init) { } +#endif + #ifdef CONFIG_GENERIC_BUG void module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, struct module *); diff --git a/kernel/module.c b/kernel/module.c index cd215580fb45..76adc8e0ed10 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -2000,7 +2000,7 @@ static void frob_writable_data(const struct module_layout *layout, (layout->size - layout->ro_after_init_size) >> PAGE_SHIFT); } -static void module_enable_ro(const struct module *mod, bool after_init) +void module_enable_ro(const struct module *mod, bool after_init) { if (!rodata_enabled) return; @@ -2028,7 +2028,6 @@ static void module_enable_nx(const struct module *mod) #else /* !CONFIG_STRICT_MODULE_RWX */ static void module_enable_nx(const struct module *mod) { } -static void module_enable_ro(const struct module *mod, bool after_init) {} #endif /* CONFIG_STRICT_MODULE_RWX */ static void module_enable_x(const struct module *mod) {