summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2015-05-09 03:06:23 +0930
committerSasha Levin <sasha.levin@oracle.com>2015-06-09 14:31:44 -0400
commite831585eb8fc7dfb64515c86db2205164d0eeb61 (patch)
tree6be3bdafb2f6c61c3c7858d85fd0c07c6dd9750d /kernel
parent5fcf8812fdf03db0b54946f4cc909dd70c417d8e (diff)
downloadlwn-e831585eb8fc7dfb64515c86db2205164d0eeb61.tar.gz
lwn-e831585eb8fc7dfb64515c86db2205164d0eeb61.zip
module: Call module notifier on failure after complete_formation()
[ Upstream commit 37815bf866ab6722a47550f8d25ad3f1a16a680c ] 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> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 88cec1ddb1e3..c353707bbbd5 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3307,6 +3307,9 @@ static int load_module(struct load_info *info, const char __user *uargs,
module_bug_cleanup(mod);
mutex_unlock(&module_mutex);
+ blocking_notifier_call_chain(&module_notify_list,
+ MODULE_STATE_GOING, mod);
+
/* we can't deallocate the module until we clear memory protection */
unset_module_init_ro_nx(mod);
unset_module_core_ro_nx(mod);