projects/linux·commit 50edb5cc

Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux

50edb5cc · Linus Torvalds <[email protected]> · 2014-10-18 10:24:26 -07:00

Pull module fix from Rusty Russell:
 "A single panic fix for a rare race, stable CC'd"

* tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  modules, lock around setting of MODULE_STATE_UNFORMED
Commit
50edb5cc22c7b2ea7df095913596e5a649bd6b41
Parents
ad3118b9 · d3051b48

Merge commit. Changes below are compared with the first parent: ad3118b9.

Changes

1 files changed · +2 −0

FileStatusAddDelContent
kernel/module.cmodified+2−0View file

kernel/module.c

View file
diff --git a/kernel/module.c b/kernel/module.c
index 65586ff..88cec1d 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1842,7 +1842,9 @@ static void free_module(struct module *mod)
/* We leave it in list to prevent duplicate loads, but make sure
* that noone uses it while it's being deconstructed. */
+ mutex_lock(&module_mutex);
mod->state = MODULE_STATE_UNFORMED;
+ mutex_unlock(&module_mutex);
/* Remove dynamic debug info */
ddebug_remove_module(mod->name);