Commit 3e4ea6c8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] module unload deadlock fix

From: Rusty Russell <rusty@rustcorp.com.au>

From: Andrea Arcangeli <andrea@suse.de>

We should drop module sem before calling mod->exit, for practical reasons:
too many module exit functions oops or hang, resulting in a permenantly held
module sem, which blocks all module ops including lsmod.
parent 66b99421
...@@ -596,7 +596,9 @@ sys_delete_module(const char __user *name_user, unsigned int flags) ...@@ -596,7 +596,9 @@ sys_delete_module(const char __user *name_user, unsigned int flags)
wait_for_zero_refcount(mod); wait_for_zero_refcount(mod);
/* Final destruction now noone is using it. */ /* Final destruction now noone is using it. */
up(&module_mutex);
mod->exit(); mod->exit();
down(&module_mutex);
free_module(mod); free_module(mod);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment