public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.5.59 vmlinux.lds.S change broke modules
@ 2003-01-17 12:55 Mikael Pettersson
  2003-01-17 13:44 ` Brian Gerst
                   ` (5 more replies)
  0 siblings, 6 replies; 21+ messages in thread
From: Mikael Pettersson @ 2003-01-17 12:55 UTC (permalink / raw)
  To: kai; +Cc: rusty, linux-kernel

Previously today I wrote:
 > 2.5.59 with CONFIG_PACKET=m oopes when af_packet.ko is insmodded:
 > 
 > Unable to handle kernel paging request at virtual address 2220c021
 >  printing eip:
 > c0124011
 > *pde = 00000000
 > Oops: 0000
 > CPU:    0
 > EIP:    0060:[<c0124011>]    Not tainted
 > EFLAGS: 00010097
 > EIP is at __find_symbol+0x3d/0x7c
 > eax: c020f70e   ebx: 00000536   ecx: 00000000   edx: c028b600
 > esi: 2220c021   edi: e8889558   ebp: e8889558   esp: e67c5ecc
 > ds: 007b   es: 007b   ss: 0068
 > Process insmod (pid: 482, threadinfo=e67c4000 task=e6c80ce0)
 > Stack: e8888f34 e8889a40 00000038 e8883f50 c0124960 e8889558 e67c5ef4 00000001 
 >        e8888f34 e8889374 e67c5f28 c0124b2a e8883f50 00000016 e8889374 e8889558 
 >        e8889a40 e8883f50 0000000c 00000017 e8889a40 00000000 0000007c c01253a4 
 > Call Trace:
 >  [<c0124960>] resolve_symbol+0x20/0x4c
 >  [<c0124b2a>] simplify_symbols+0x82/0xe4
 >  [<c01253a4>] load_module+0x5c4/0x7ec
 >  [<c012562b>] sys_init_module+0x5f/0x194
 >  [<c0108887>] syscall_call+0x7/0xb

This oops occurs for every module, not just af_packet.ko, at
resolve_symbol()'s first call to __find_symbol().

What happens is that __find_symbol() oopses because the kernel's
symbol table is in la-la land. (Note the bogus kernel adress
2220c021 it tried to dereference above.)

Reverting 2.5.59's patch to arch/i386/vmlinux.lds.S cured the
problem and modules now load correctly for me.

I don't know if this is a problem also for non-i386 archs.

/Mikael

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: 2.5.59 vmlinux.lds.S change broke modules
@ 2003-01-17 13:27 Adam J. Richter
  0 siblings, 0 replies; 21+ messages in thread
From: Adam J. Richter @ 2003-01-17 13:27 UTC (permalink / raw)
  To: linux-kernel, mikpe

	I believe I'm experiencing the same problem that Mikael Pettersson
reported, although the symptom is normally a hang with SMP, because
the bad pointer dereference in __find_symbol results in the fault
hanndler calling search_exception_tables, which calls search_module_extable,
which tries to grab the modlist_lock spinlock, but that lock was
already taken by resolve_symbol (which called __find_symbol in the first
place).

	Somone else on irc reported a similar problem when I asked.

	Thanks Mikael, for posting the kernel oops listing.  You
probably just saved me about 45 minutes of switching over to a
non-SMP kernel to check for that oops.

Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."

^ permalink raw reply	[flat|nested] 21+ messages in thread
* Re: 2.5.59 vmlinux.lds.S change broke modules
@ 2003-01-18 14:36 Mikael Pettersson
  0 siblings, 0 replies; 21+ messages in thread
From: Mikael Pettersson @ 2003-01-18 14:36 UTC (permalink / raw)
  To: kai; +Cc: linux-kernel

On Fri, 17 Jan 2003 18:11:01 -0600 (CST), Kai Germaschewski wrote:
>Okay, the details I received so far seem to indicate that the appended 
>patch will fix it, though I didn't get actual confirmation it does.
>
>If you experience crashes when loading modules (and have RH 8 binutils), 
>please give it a shot.
...
>diff -Nru a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
>--- a/include/asm-generic/vmlinux.lds.h	Fri Jan 17 10:09:57 2003
>+++ b/include/asm-generic/vmlinux.lds.h	Fri Jan 17 10:09:57 2003
>@@ -13,18 +13,18 @@
> 	}								\
> 									\
> 	/* Kernel symbol table: Normal symbols */			\
>-	__start___ksymtab = .;						\
> 	__ksymtab         : AT(ADDR(__ksymtab) - LOAD_OFFSET) {		\
>+		__start___ksymtab = .;					\
> 		*(__ksymtab)						\
>+		__stop___ksymtab = .;					\
> 	}								\
>-	__stop___ksymtab = .;						\
> 									\
> 	/* Kernel symbol table: GPL-only symbols */			\
>-	__start___gpl_ksymtab = .;					\
> 	__gpl_ksymtab     : AT(ADDR(__gpl_ksymtab) - LOAD_OFFSET) {	\
>+		__start___gpl_ksymtab = .;				\
> 		*(__gpl_ksymtab)					\
>+		__stop___gpl_ksymtab = .;				\
> 	}								\
>-	__stop___gpl_ksymtab = .;					\
> 									\
> 	/* Kernel symbol table: strings */				\
>         __ksymtab_strings : AT(ADDR(__ksymtab_strings) - LOAD_OFFSET) {	\
>

This patch fixed the module-loading problem for me. Thanks.

Note that the problem wasn't specific to RH8.0 binutils:
I've also seen it with binutils-2.10.91 from RH7.1.

/Mikael

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2003-01-18 14:31 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-17 12:55 2.5.59 vmlinux.lds.S change broke modules Mikael Pettersson
2003-01-17 13:44 ` Brian Gerst
2003-01-17 13:49   ` Mikael Pettersson
2003-01-17 14:32     ` Mike Galbraith
2003-01-17 13:56 ` Russell King
2003-01-17 16:13   ` Eric W. Biederman
2003-01-17 16:21     ` Sam Ravnborg
2003-01-18  3:08       ` Eric W. Biederman
2003-01-17 16:24     ` Kai Germaschewski
2003-01-17 16:50       ` Russell King
2003-01-17 16:19   ` Sam Ravnborg
2003-01-17 14:44 ` Kai Germaschewski
2003-01-18  0:11 ` Kai Germaschewski
2003-01-18  5:45   ` Christopher Faylor
2003-01-18  6:14     ` J Sloan
2003-01-18  8:00 ` Mike Galbraith
2003-01-18  9:23   ` Sam Ravnborg
2003-01-18  9:34     ` Mike Galbraith
     [not found] ` <Pine.LNX.4.44.0301171808010.15056-100000@chaos.physics.uio wa.edu>
2003-01-18  9:07   ` Mike Galbraith
  -- strict thread matches above, loose matches on Subject: below --
2003-01-17 13:27 Adam J. Richter
2003-01-18 14:36 Mikael Pettersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox