summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2015-07-09 06:48:06 +0930
committerRusty Russell <rusty@rustcorp.com.au>2015-07-09 06:57:12 +0930
commit758556bdc1c8a8dffea0ea9f9df891878cc2468c (patch)
tree215394779cca168f57e48fda3cf8c91f451a42c8 /kernel
parent45820c294fe1b1a9df495d57f40585ef2d069a39 (diff)
downloadlinux-stable-758556bdc1c8a8dffea0ea9f9df891878cc2468c.tar.gz
linux-stable-758556bdc1c8a8dffea0ea9f9df891878cc2468c.tar.bz2
linux-stable-758556bdc1c8a8dffea0ea9f9df891878cc2468c.zip
module: Fix load_module() error path
The load_module() error path frees a module but forgot to take it out of the mod_tree, leaving a dangling entry in the tree, causing havoc. Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Reported-by: Arthur Marsh <arthur.marsh@internode.on.net> Tested-by: Arthur Marsh <arthur.marsh@internode.on.net> Fixes: 93c2e105f6bc ("module: Optimize __module_address() using a latched RB-tree") Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/module.c b/kernel/module.c
index 3e0e19763d24..4d2b82e610e2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -3557,6 +3557,7 @@ static int load_module(struct load_info *info, const char __user *uargs,
mutex_lock(&module_mutex);
/* Unlink carefully: kallsyms could be walking list. */
list_del_rcu(&mod->list);
+ mod_tree_remove(mod);
wake_up_all(&module_wq);
/* Wait for RCU-sched synchronizing before releasing mod->list. */
synchronize_sched();