alistair23-linux/arch/mn10300/kernel
Linus Torvalds 5336377d62 modules: Fix module_bug_list list corruption race
With all the recent module loading cleanups, we've minimized the code
that sits under module_mutex, fixing various deadlocks and making it
possible to do most of the module loading in parallel.

However, that whole conversion totally missed the rather obscure code
that adds a new module to the list for BUG() handling.  That code was
doubly obscure because (a) the code itself lives in lib/bugs.c (for
dubious reasons) and (b) it gets called from the architecture-specific
"module_finalize()" rather than from generic code.

Calling it from arch-specific code makes no sense what-so-ever to begin
with, and is now actively wrong since that code isn't protected by the
module loading lock any more.

So this commit moves the "module_bug_{finalize,cleanup}()" calls away
from the arch-specific code, and into the generic code - and in the
process protects it with the module_mutex so that the list operations
are now safe.

Future fixups:
 - move the module list handling code into kernel/module.c where it
   belongs.
 - get rid of 'module_bug_list' and just use the regular list of modules
   (called 'modules' - imagine that) that we already create and maintain
   for other reasons.

Reported-and-tested-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-10-05 11:29:27 -07:00
..
asm-offsets.c MN10300: Handle removal of struct uart_info 2009-09-23 10:15:21 -07:00
entry.S Add generic sys_old_select() 2010-03-12 15:52:32 -08:00
fpu-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
fpu.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
gdb-cache.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
gdb-io-serial-low.S Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-io-serial.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-io-ttysm-low.S Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-io-ttysm.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
gdb-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
gdb-stub.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
head.S mn10300: convert to use __HEAD and HEAD_TEXT macros. 2009-04-26 09:20:38 -07:00
init_task.c Use new __init_task_data macro in arch init_task.c files. 2009-09-21 06:27:08 +02:00
internal.h mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
io.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
irq.c genirq: Convert irq_desc.lock to raw_spinlock 2009-12-14 23:55:33 +01:00
kernel_execve.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
kprobes.c percpu: make misc percpu symbols unique 2009-10-29 22:34:14 +09:00
kthread.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
Makefile Generic semaphore implementation 2008-04-17 10:42:34 -04:00
mn10300-debug.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
mn10300-serial-low.S MN10300: Handle removal of struct uart_info 2009-09-23 10:15:21 -07:00
mn10300-serial.c MN10300: Fix up the IRQ names for the on-chip serial ports 2010-09-14 17:06:28 -07:00
mn10300-serial.h mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
mn10300-watchdog-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
mn10300-watchdog.c Separate out the proc- and unit-specific header directories from the general 2009-04-10 14:33:48 +01:00
mn10300_ksyms.c mn10300: provide __ucmpdi2() for MN10300 2008-07-04 10:40:07 -07:00
module.c modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
process.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
profile-low.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
profile.c mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
ptrace.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
rtc.c MN10300: Fix RTC routines 2010-08-12 09:51:35 -07:00
setup.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
sigframe.h mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
signal.c mn10300: check __get_user/__put_user results... 2010-09-27 12:19:53 -07:00
switch_to.S mn10300: add the MN10300/AM33 architecture to the kernel 2008-02-08 09:22:30 -08:00
sys_mn10300.c Add generic sys_ipc wrapper 2010-03-12 15:52:32 -08:00
time.c mn10300: Convert mn10300 to use read/update_persistent_clock 2010-03-13 01:14:09 +01:00
traps.c headers: smp_lock.h redux 2009-07-12 12:22:34 -07:00
vmlinux.lds.S mn10300: Clean up linker script using higher-level macros. 2009-09-24 17:16:22 -07:00