summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2017-02-17 11:36:46 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2017-02-17 11:36:46 +1100
commit335d9007e2b62fba810e5054ed46b1f4969677bb (patch)
tree81970be0d4734a03077039450049cb00329d1bc5 /kernel
parentfded258e71f0c932acbabea4275bd8d0c7d11e3e (diff)
parent91168dd66096645bf9ae678041dc1bfb6fa2ae76 (diff)
Merge remote-tracking branch 'modules/modules-next'
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 58856a46db80..bf08c96ba9fb 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2809,6 +2809,8 @@ static int check_modinfo_livepatch(struct module *mod, struct load_info *info)
if (get_modinfo(info, "livepatch")) {
mod->klp = true;
add_taint_module(mod, TAINT_LIVEPATCH, LOCKDEP_STILL_OK);
+ pr_notice_once("%s: tainting kernel with TAINT_LIVEPATCH\n",
+ mod->name);
}
return 0;
@@ -3719,6 +3721,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
mod_sysfs_teardown(mod);
coming_cleanup:
mod->state = MODULE_STATE_GOING;
+ destroy_params(mod->kp, mod->num_kp);
blocking_notifier_call_chain(&module_notify_list,
MODULE_STATE_GOING, mod);
klp_module_going(mod);
@@ -4165,22 +4168,23 @@ const struct exception_table_entry *search_module_extables(unsigned long addr)
struct module *mod;
preempt_disable();
- list_for_each_entry_rcu(mod, &modules, list) {
- if (mod->state == MODULE_STATE_UNFORMED)
- continue;
- if (mod->num_exentries == 0)
- continue;
+ mod = __module_address(addr);
+ if (!mod)
+ goto out;
- e = search_extable(mod->extable,
- mod->extable + mod->num_exentries - 1,
- addr);
- if (e)
- break;
- }
+ if (!mod->num_exentries)
+ goto out;
+
+ e = search_extable(mod->extable,
+ mod->extable + mod->num_exentries - 1,
+ addr);
+out:
preempt_enable();
- /* Now, if we found one, we are running inside it now, hence
- we cannot unload the module, hence no refcnt needed. */
+ /*
+ * Now, if we found one, we are running inside it now, hence
+ * we cannot unload the module, hence no refcnt needed.
+ */
return e;
}