linux-kernel-test/arch
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
..
alpha Fix up more fallout form alpha signal cleanups 2010-09-30 08:37:38 -07:00
arm Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6 2010-10-01 10:53:06 -07:00
avr32 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
blackfin Blackfin: bf52x/bf54x boards: drop unused nand page size 2010-08-27 16:08:43 -04:00
cris Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
frv frv: double syscall restarts, syscall restart in sigreturn() 2010-09-20 10:44:38 -07:00
h8300 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
ia64 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6 2010-09-16 12:58:44 -07:00
m32r m32r: fix breakage from "m32r: use generic ptrace_resume code" 2010-09-24 13:54:19 -07:00
m68k arch/m68k/mac/macboing.c: use unsigned long for irqflags 2010-10-01 10:50:58 -07:00
m68knommu m68k,m68knommu: Wire up fanotify_init, fanotify_mark, and prlimit64 2010-09-13 20:28:45 +02:00
microblaze Merge branch 'merge-devicetree' of git://git.secretlab.ca/git/linux-2.6 2010-08-18 09:26:17 -07:00
mips compat: Make compat_alloc_user_space() incorporate the access_ok() 2010-09-14 16:08:45 -07:00
mn10300 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
parisc modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
powerpc modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
s390 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
score Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
sh modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
sparc Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6 2010-09-22 12:09:46 -07:00
tile Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2010-09-24 19:08:39 -07:00
um Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-10-04 11:11:01 -07:00
x86 modules: Fix module_bug_list list corruption race 2010-10-05 11:29:27 -07:00
xtensa Make do_execve() take a const filename pointer 2010-08-17 18:07:43 -07:00
.gitignore
Kconfig kprobes: Fix Kconfig dependency 2010-09-13 20:41:31 +02:00