linux-stable-rt/arch/sh/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
..
cpu sh: fix up sh7786 dmaengine build. 2010-05-22 17:12:23 +09:00
vsyscall
.gitignore
Makefile sh: support for platforms without PIO. 2010-06-02 16:31:42 +09:00
asm-offsets.c
clkdev.c fix typos concerning "precedence" 2010-06-17 11:31:19 +02:00
cpufreq.c
crash_dump.c
debugtraps.S
disassemble.c
dma-nommu.c
dumpstack.c
dwarf.c sh: handle early calls to return_address() when using dwarf unwinder. 2010-05-25 16:16:40 +09:00
entry-common.S
ftrace.c
head_32.S
head_64.S
hw_breakpoint.c
idle.c
init_task.c
io.c sh: support for platforms without PIO. 2010-06-02 16:31:42 +09:00
io_generic.c sh: support for platforms without PIO. 2010-06-02 16:31:42 +09:00
io_trapped.c sh: support for platforms without PIO. 2010-06-02 16:31:42 +09:00
irq.c
irq_32.c
irq_64.c
kgdb.c
kprobes.c
localtimer.c
machine_kexec.c lmb: rename to memblock 2010-07-14 17:14:00 +10:00
machvec.c sh: support for platforms without PIO. 2010-06-02 16:31:42 +09:00
module.c modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
nmi_debug.c
perf_callchain.c
perf_event.c perf: Convert perf_event to local_t 2010-06-09 11:12:37 +02:00
process.c
process_32.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
process_64.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
ptrace_32.c ptrace: unify FDPIC implementations 2010-05-27 09:12:44 -07:00
ptrace_64.c
reboot.c
relocate_kernel.S
return_address.c sh: handle early calls to return_address() when using dwarf unwinder. 2010-05-25 16:16:40 +09:00
setup.c lmb: rename to memblock 2010-07-14 17:14:00 +10:00
sh_bios.c
sh_ksyms_32.c
sh_ksyms_64.c
signal_32.c
signal_64.c
smp.c
stacktrace.c
swsusp.c
sys_sh.c
sys_sh32.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
sys_sh64.c Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
syscalls_32.S
syscalls_64.S
time.c
topology.c
traps.c
traps_32.c
traps_64.c
unwinder.c
vmlinux.lds.S