diff options
| author | Rusty Russell <rusty@rustcorp.com.au> | 2004-06-26 20:55:19 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-06-26 20:55:19 -0700 |
| commit | 969eb7b840c13a73190d98a608b8fec50dc31971 (patch) | |
| tree | b0af0354e990cb82bfa1e9ceeaf46ca9be9567e7 /kernel/extable.c | |
| parent | 12d9986b3c8acda935906514c593ea806e1736bd (diff) | |
[PATCH] Fix race between CONFIG_DEBUG_SLABALLOC and modules
store_stackinfo() does an unlocked module list walk during normal runtime
which opens up a race with the module load/unload code. This can be
triggered by simply unloading and loading a module in a loop with
CONFIG_DEBUG_PAGEALLOC resulting in store_stackinfo() tripping over bad
list pointers.
kernel_text_address doesn't take any locks, because during an OOPS we don't
want to deadlock. Rename that to __kernel_text_address, and make
kernel_text_address take the lock.
Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/extable.c')
| -rw-r--r-- | kernel/extable.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/extable.c b/kernel/extable.c index fbbfbf4fd367..7501b531ceed 100644 --- a/kernel/extable.c +++ b/kernel/extable.c @@ -40,7 +40,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) return e; } -int kernel_text_address(unsigned long addr) +static int core_kernel_text(unsigned long addr) { if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext) @@ -49,6 +49,19 @@ int kernel_text_address(unsigned long addr) if (addr >= (unsigned long)_sinittext && addr <= (unsigned long)_einittext) return 1; + return 0; +} +int __kernel_text_address(unsigned long addr) +{ + if (core_kernel_text(addr)) + return 1; + return __module_text_address(addr) != NULL; +} + +int kernel_text_address(unsigned long addr) +{ + if (core_kernel_text(addr)) + return 1; return module_text_address(addr) != NULL; } |
