[SRU][F][PATCH 6/8] UBUNTU: SAUCE: Revert "modules: mark each_symbol_section static"

Ian May ian.may at canonical.com
Tue Jun 15 22:04:06 UTC 2021


BugLink: https://bugs.launchpad.net/bugs/1932065

This reverts commit c08935472a88ab208e3f6f4aade27216875c6b74.

Upstream introduced 'module' patches that removed exported symbols
that might cause potential disruption and breakage for customers.

Temporarily reverting as SAUCE patches to allow customers time to
make necessary changes to support patch changes.

Signed-off-by: Ian May <ian.may at canonical.com>
---
 include/linux/module.h | 9 +++++++++
 kernel/module.c        | 3 ++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index 37468023b219..d9d393ba17be 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -569,6 +569,15 @@ struct symsearch {
 	bool unused;
 };
 
+/*
+ * Walk the exported symbol table
+ *
+ * Must be called with module_mutex held or preemption disabled.
+ */
+bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
+				    struct module *owner,
+				    void *data), void *data);
+
 /* Returns 0 and fills in value, defined and namebuf, or -ERANGE if
    symnum out of range. */
 int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
diff --git a/kernel/module.c b/kernel/module.c
index 13ec39a09f16..023fec24be52 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -420,7 +420,7 @@ static bool each_symbol_in_section(const struct symsearch *arr,
 }
 
 /* Returns true as soon as fn returns true, otherwise false. */
-static bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
+bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
 				    struct module *owner,
 				    void *data),
 			 void *data)
@@ -482,6 +482,7 @@ static bool each_symbol_section(bool (*fn)(const struct symsearch *arr,
 	}
 	return false;
 }
+EXPORT_SYMBOL_GPL(each_symbol_section);
 
 struct find_symbol_arg {
 	/* Input */
-- 
2.25.1




More information about the kernel-team mailing list