Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 758556bd authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Rusty Russell
Browse files

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: default avatarArthur Marsh <arthur.marsh@internode.on.net>
Tested-by: default avatarArthur Marsh <arthur.marsh@internode.on.net>
Fixes: 93c2e105 ("module: Optimize __module_address() using a latched RB-tree")
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
parent 45820c29
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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();