[SRU][G][PATCH 2/8] UBUNTU: SAUCE: Revert "modules: return licensing information from find_symbol"
Ian May
ian.may at canonical.com
Thu Jun 17 20:39:11 UTC 2021
BugLink: https://bugs.launchpad.net/bugs/1932065
This reverts commit b43557395d45608d263e785da2cb0c2cb50f94ff.
Upstream introduced 'module' patches that removed exported symbols
that might cause potential disruption and breakage for customers.
Reverting as SAUCE patches to prevent regressions.
Signed-off-by: Ian May <ian.may at canonical.com>
---
include/linux/module.h | 2 +-
kernel/module.c | 16 +++++-----------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/include/linux/module.h b/include/linux/module.h
index 30b0f5fcdb3c..be04ba2f881d 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -582,7 +582,7 @@ struct module *find_module(const char *name);
struct symsearch {
const struct kernel_symbol *start, *stop;
const s32 *crcs;
- enum mod_license {
+ enum {
NOT_GPL_ONLY,
GPL_ONLY,
WILL_BE_GPL_ONLY,
diff --git a/kernel/module.c b/kernel/module.c
index f0e8f2c417f9..03e0170a0d65 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -496,7 +496,6 @@ struct find_symbol_arg {
struct module *owner;
const s32 *crc;
const struct kernel_symbol *sym;
- enum mod_license license;
};
static bool check_exported_symbol(const struct symsearch *syms,
@@ -530,7 +529,6 @@ static bool check_exported_symbol(const struct symsearch *syms,
fsa->owner = owner;
fsa->crc = symversion(syms->crcs, symnum);
fsa->sym = &syms->start[symnum];
- fsa->license = syms->license;
return true;
}
@@ -590,7 +588,6 @@ static bool find_exported_symbol_in_section(const struct symsearch *syms,
static const struct kernel_symbol *find_symbol(const char *name,
struct module **owner,
const s32 **crc,
- enum mod_license *license,
bool gplok,
bool warn)
{
@@ -605,8 +602,6 @@ static const struct kernel_symbol *find_symbol(const char *name,
*owner = fsa.owner;
if (crc)
*crc = fsa.crc;
- if (license)
- *license = fsa.license;
return fsa.sym;
}
@@ -1080,7 +1075,7 @@ void __symbol_put(const char *symbol)
struct module *owner;
preempt_disable();
- if (!find_symbol(symbol, &owner, NULL, NULL, true, false))
+ if (!find_symbol(symbol, &owner, NULL, true, false))
BUG();
module_put(owner);
preempt_enable();
@@ -1358,7 +1353,7 @@ static inline int check_modstruct_version(const struct load_info *info,
* locking is necessary -- use preempt_disable() to placate lockdep.
*/
preempt_disable();
- if (!find_symbol("module_layout", NULL, &crc, NULL, true, false)) {
+ if (!find_symbol("module_layout", NULL, &crc, true, false)) {
preempt_enable();
BUG();
}
@@ -1442,7 +1437,6 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
struct module *owner;
const struct kernel_symbol *sym;
const s32 *crc;
- enum mod_license license;
int err;
/*
@@ -1452,7 +1446,7 @@ static const struct kernel_symbol *resolve_symbol(struct module *mod,
*/
sched_annotate_sleep();
mutex_lock(&module_mutex);
- sym = find_symbol(name, &owner, &crc, &license,
+ sym = find_symbol(name, &owner, &crc,
!(mod->taints & (1 << TAINT_PROPRIETARY_MODULE)), true);
if (!sym)
goto unlock;
@@ -2237,7 +2231,7 @@ void *__symbol_get(const char *symbol)
const struct kernel_symbol *sym;
preempt_disable();
- sym = find_symbol(symbol, &owner, NULL, NULL, true, true);
+ sym = find_symbol(symbol, &owner, NULL, true, true);
if (sym && strong_try_module_get(owner))
sym = NULL;
preempt_enable();
@@ -2273,7 +2267,7 @@ static int verify_exported_symbols(struct module *mod)
for (i = 0; i < ARRAY_SIZE(arr); i++) {
for (s = arr[i].sym; s < arr[i].sym + arr[i].num; s++) {
if (find_symbol(kernel_symbol_name(s), &owner, NULL,
- NULL, true, false)) {
+ true, false)) {
pr_err("%s: exports duplicate symbol %s"
" (owned by %s)\n",
mod->name, kernel_symbol_name(s),
--
2.25.1
More information about the kernel-team
mailing list