diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2015-05-08 13:36:23 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2015-05-08 13:59:24 -0400 |
commit | 37815bf866ab6722a47550f8d25ad3f1a16a680c (patch) | |
tree | fdb27ea2c0267dea6a4ce5cfcaad8c32db47a15e /kernel | |
parent | 3e0283a53f7d2f2dae7bc4aa7f3104cb5988018f (diff) |
module: Call module notifier on failure after complete_formation()
The module notifier call chain for MODULE_STATE_COMING was moved up before
the parsing of args, into the complete_formation() call. But if the module failed
to load after that, the notifier call chain for MODULE_STATE_GOING was
never called and that prevented the users of those call chains from
cleaning up anything that was allocated.
Link: http://lkml.kernel.org/r/554C52B9.9060700@gmail.com
Reported-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Fixes: 4982223e51e8 "module: set nx before marking module MODULE_STATE_COMING"
Cc: stable@vger.kernel.org # 3.16+
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c index 42a1d2afb217..cfc9e843a924 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -3370,6 +3370,9 @@ static int load_module(struct load_info *info, const char __user *uargs, | |||
3370 | module_bug_cleanup(mod); | 3370 | module_bug_cleanup(mod); |
3371 | mutex_unlock(&module_mutex); | 3371 | mutex_unlock(&module_mutex); |
3372 | 3372 | ||
3373 | blocking_notifier_call_chain(&module_notify_list, | ||
3374 | MODULE_STATE_GOING, mod); | ||
3375 | |||
3373 | /* we can't deallocate the module until we clear memory protection */ | 3376 | /* we can't deallocate the module until we clear memory protection */ |
3374 | unset_module_init_ro_nx(mod); | 3377 | unset_module_init_ro_nx(mod); |
3375 | unset_module_core_ro_nx(mod); | 3378 | unset_module_core_ro_nx(mod); |