From: Robin Getz <rgetz@blackfin.uclinux.org>
Today, when module names are looked up, we do not qualify them (check to see
if the init section is still active or not). This can lead to problems when
kernel modules get loaded into the same address that the kernel init section
(or other module's init section was at). We sometimes return the old / no
lomnger there
This leads to bogus OOPS messages, and developers wasting their time looking
for problems (in the kernel init section) where there are none (since it was
a module).
This patch qualifies the addresses, to make sure the addresses are still valid
before label/offset.
Signed-off-by: Robin Getz <rgetz@blackfin.uclinux.org>
---
linux-2.6.x/kernel/kallsyms.c | 3 ++-
linux-2.6.x/kernel/module.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
Index: linux-2.6.x/kernel/kallsyms.c
===================================================================
--- linux-2.6.x/kernel/kallsyms.c (revision 4212)
+++ linux-2.6.x/kernel/kallsyms.c (working copy)
@@ -42,7 +42,8 @@
static inline int is_kernel_inittext(unsigned long addr)
{
- if (addr >= (unsigned long)_sinittext
+ if (system_state == SYSTEM_BOOTING
+ && addr >= (unsigned long)_sinittext
&& addr <= (unsigned long)_einittext)
return 1;
return 0;
Index: linux-2.6.x/kernel/module.c
===================================================================
--- linux-2.6.x/kernel/module.c (revision 4212)
+++ linux-2.6.x/kernel/module.c (working copy)
@@ -2121,7 +2121,8 @@
struct module *mod;
list_for_each_entry(mod, &modules, list) {
- if (within(addr, mod->module_init, mod->init_size)
+ if ((within(addr, mod->module_init, mod->init_size)
+ && mod->state == MODULE_STATE_COMING)
|| within(addr, mod->module_core, mod->core_size)) {
if (modname)
*modname = mod->name;
--
| James Bottomley | Re: Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
| majkls | sys_chroot+sys_fchdir Fix |
| Paul Mackerras | Re: [linux-pm] [PATCH] Remove process freezer from suspend to RAM pathway |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
