public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6.0-test8/9] ethertap oops
@ 2003-10-26 22:02 Simon Roscic
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Roscic @ 2003-10-26 22:02 UTC (permalink / raw)
  To: linux-kernel

(please cc me, as i´m not subscribed to lkml - thanks)

hi,

last week i started playing around with -test8, wich was working
very well on my machine, except ethertap, wich oopsed ...
i tried again with -test9, and as i expected (changelog doesnt
mention ethertap changes) i got the same oops.

i need ethertap for the vpn software (phion vpn) we use
at the office, the phion vpn client uses the ethertap
device and works well with kernel 2.4 series, but 
on 2.6 it doesn't work. (tried with -test8 & 9)
the initial connect seems to work, i see the vpn motd 
(the vpn client is an ncurses program), but as soon
as i try to do something eg. ping, or as soon as 
network traffic is going to / coming from the vpn, 
i get the following oops:

Unable to handle kernel paging request at virtual address 0000885e
 printing eip:
e18792d1
*pde = 00000000
Oops: 0002 [#1]
CPU:    0
EIP:    0060:[<e18792d1>]    Not tainted
EFLAGS: 00010246
EIP is at ethertap_rx+0x131/0x2a0 [ethertap]
eax: 00000000   ebx: df344840   ecx: 00000000   edx: 00000800
esi: 0000885a   edi: df3448a4   ebp: 00000048   esp: de421d84
ds: 007b   es: 007b   ss: 0068
Process phionvpn (pid: 553, threadinfo=de420000 task=df746080)
Stack: df344840 de579ecc 00000011 dffcdc04 de420000 de579ecc dffcdbc0 de420000
       dffcdbc0 df633c80 c030d979 dffcdbc0 00000048 df344840 c030d050 dffcdbc0
       00000048 7fffffff 00000010 00000048 00000000 df746080 c0117370 00000000
Call Trace:
 [<c030d979>] netlink_data_ready+0x59/0x70
 [<c030d050>] netlink_unicast+0x290/0x340
 [<c0117370>] default_wake_function+0x0/0x30
 [<c0117370>] default_wake_function+0x0/0x30
 [<c02fd267>] alloc_skb+0x47/0xe0
 [<c030d632>] netlink_sendmsg+0x202/0x2f0
 [<c0117099>] schedule+0x2f9/0x580
 [<c02f980e>] sock_sendmsg+0x9e/0xd0
 [<c030e590>] netlink_write+0x0/0x80
 [<c030e600>] netlink_write+0x70/0x80
 [<c014d128>] vfs_write+0xb8/0x130
 [<c014d252>] sys_write+0x42/0x70
 [<c01091db>] syscall_call+0x7/0xb

Code: ff 46 04 01 6e 0c 89 1c 24 e8 51 85 a8 de 8b 54 24 14 a1 80

i´ve put up further information here:

kernel 2.6.0-test9 (vanilla+con`s swappiness autoregulation patch):

kernel .config:
http://segfault.info/simon/ethertap-oops/2.6.0-test9/kernel-2.6.0-test9.config
dmesg output:
http://segfault.info/simon/ethertap-oops/2.6.0-test9/dmesg-2.6.0-test9
ksymoops (useless on 2.6? - i remember there was some discussion on lkml a while back):
http://segfault.info/simon/ethertap-oops/2.6.0-test9/ksymoops-2.6.0-test9
the oops:
http://segfault.info/simon/ethertap-oops/2.6.0-test9/oops-2.6.0-test9
strace of the phion vpn client, one on kernel 2.4.22, and one on kernel 2.6.0-test9:
http://segfault.info/simon/ethertap-oops/2.6.0-test9/phion-strace-2.4.22
http://segfault.info/simon/ethertap-oops/2.6.0-test9/phion-strace-2.6.0-test9
ver_linux output:
http://segfault.info/simon/ethertap-oops/2.6.0-test9/ver_linux

kernel 2.6.0-test8 (vanilla, without any other patches):

kernel .config:
http://segfault.info/simon/ethertap-oops/2.6.0-test8/kernel-2.6.0-test8.config
ksymoops (useless on 2.6? - i remember there was some discussion on lkml a while back):
http://segfault.info/simon/ethertap-oops/2.6.0-test8/ksymoops-2.6.0-test8
the oops:
http://segfault.info/simon/ethertap-oops/2.6.0-test8/oops-2.6.0-test8
strace of the phion vpn client, one on kernel 2.4.22, and one on kernel 2.6.0-test8:
http://segfault.info/simon/ethertap-oops/2.6.0-test8/phion-strace-2.4.22
http://segfault.info/simon/ethertap-oops/2.6.0-test8/phion-strace-2.6.0-test8
ver_linux output:
http://segfault.info/simon/ethertap-oops/2.6.0-test8/ver_linux

i dont know, how  "clean" the phion vpn client software is, as it is a
closed source :(  program, but i think even if a program does something
ugly with ethertap it should not oops. (and it works on 2.4)
i hope the provided information is useable, if you need more information,
logs, etc. just mail me.

bye,
	simon.


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

* Re: [2.6.0-test8/9] ethertap oops
       [not found] <L1fo.3gb.9@gated-at.bofh.it>
@ 2003-10-26 22:45 ` Andi Kleen
  2003-10-27  7:48   ` David S. Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Andi Kleen @ 2003-10-26 22:45 UTC (permalink / raw)
  To: Simon Roscic; +Cc: linux-kernel, netdev

Simon Roscic <simon.roscic@chello.at> writes:

> EIP is at ethertap_rx+0x131/0x2a0 [ethertap]

Does this patch fix it?

-Andi

diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c
--- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o	2003-09-11 04:12:33.000000000 +0200
+++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c	2003-10-26 23:41:17.000000000 +0100
@@ -302,11 +302,12 @@
 
 static void ethertap_rx(struct sock *sk, int len)
 {
-	struct net_device *dev = tap_map[sk->sk_protocol];
+	unsigned unit = sk->sk_protocol - NETLINK_TAPBASE; 
+	struct net_device *dev;
 	struct sk_buff *skb;
 
-	if (dev==NULL) {
-		printk(KERN_CRIT "ethertap: bad unit!\n");
+	if (unit >= max_taps || (dev = tap_map[unit]) == NULL) { 
+		printk(KERN_CRIT "ethertap: bad unit %u!\n", unit);
 		skb_queue_purge(&sk->sk_receive_queue);
 		return;
 	}
diff -u linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c
--- linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o	2003-10-09 00:29:02.000000000 +0200
+++ linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c	2003-10-26 23:42:44.000000000 +0100
@@ -777,6 +777,7 @@
 	if (input)
 		nlk_sk(sk)->data_ready = input;
 
+	sk->sk_protocol = unit;
 	netlink_insert(sk, 0);
 	return sk;
 }

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

* Re: [2.6.0-test8/9] ethertap oops
  2003-10-26 22:45 ` [2.6.0-test8/9] ethertap oops Andi Kleen
@ 2003-10-27  7:48   ` David S. Miller
  2003-10-27 12:26     ` Andi Kleen
  0 siblings, 1 reply; 6+ messages in thread
From: David S. Miller @ 2003-10-27  7:48 UTC (permalink / raw)
  To: Andi Kleen; +Cc: simon.roscic, linux-kernel, netdev

On Sun, 26 Oct 2003 23:45:52 +0100
Andi Kleen <ak@muc.de> wrote:

> diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c
> --- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o	2003-09-11 04:12:33.000000000 +0200
> +++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c	2003-10-26 23:41:17.000000000 +0100

This part looks good, applied.

> diff -u linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c
> --- linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c-o	2003-10-09 00:29:02.000000000 +0200
> +++ linux-2.6.0test7mm1-averell/net/netlink/af_netlink.c	2003-10-26 23:42:44.000000000 +0100
> @@ -777,6 +777,7 @@
>  	if (input)
>  		nlk_sk(sk)->data_ready = input;
>  
> +	sk->sk_protocol = unit;
>  	netlink_insert(sk, 0);
>  	return sk;
>  }

This part is not needed, netlink_create() does this for us :-)

Thanks Andi.

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

* Re: [2.6.0-test8/9] ethertap oops
  2003-10-27 12:26     ` Andi Kleen
@ 2003-10-27 12:22       ` David S. Miller
  2003-10-27 17:40       ` Simon Roscic
  1 sibling, 0 replies; 6+ messages in thread
From: David S. Miller @ 2003-10-27 12:22 UTC (permalink / raw)
  To: Andi Kleen; +Cc: ak, simon.roscic, linux-kernel, netdev

On Mon, 27 Oct 2003 13:26:35 +0100
Andi Kleen <ak@suse.de> wrote:

> I don't know if it actually fixed the bug, I did not test it
> (sorry, should have stated that in the original mail)
> But at least it should printk now instead of crashing.

Ok, it's still an improvement over the blind dereferencing
it does not.

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

* Re: [2.6.0-test8/9] ethertap oops
  2003-10-27  7:48   ` David S. Miller
@ 2003-10-27 12:26     ` Andi Kleen
  2003-10-27 12:22       ` David S. Miller
  2003-10-27 17:40       ` Simon Roscic
  0 siblings, 2 replies; 6+ messages in thread
From: Andi Kleen @ 2003-10-27 12:26 UTC (permalink / raw)
  To: David S. Miller; +Cc: Andi Kleen, simon.roscic, linux-kernel, netdev

On Sun, Oct 26, 2003 at 11:48:28PM -0800, David S. Miller wrote:
> On Sun, 26 Oct 2003 23:45:52 +0100
> Andi Kleen <ak@muc.de> wrote:
> 
> > diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o linux-2.6.0test7mm1-averell/drivers/net/ethertap.c
> > --- linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o	2003-09-11 04:12:33.000000000 +0200
> > +++ linux-2.6.0test7mm1-averell/drivers/net/ethertap.c	2003-10-26 23:41:17.000000000 +0100
> 
> This part looks good, applied.

I don't know if it actually fixed the bug, I did not test it
(sorry, should have stated that in the original mail)
But at least it should printk now instead of crashing.

-Andi

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

* Re: [2.6.0-test8/9] ethertap oops
  2003-10-27 12:26     ` Andi Kleen
  2003-10-27 12:22       ` David S. Miller
@ 2003-10-27 17:40       ` Simon Roscic
  1 sibling, 0 replies; 6+ messages in thread
From: Simon Roscic @ 2003-10-27 17:40 UTC (permalink / raw)
  To: Andi Kleen, David S. Miller; +Cc: linux-kernel, netdev

On Monday, 27. Oct 2003 13:26, Andi Kleen wrote:
> On Sun, Oct 26, 2003 at 11:48:28PM -0800, David S. Miller wrote:
> > On Sun, 26 Oct 2003 23:45:52 +0100
> >
> > Andi Kleen <ak@muc.de> wrote:
> > > diff -u linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o
> > > linux-2.6.0test7mm1-averell/drivers/net/ethertap.c ---
> > > linux-2.6.0test7mm1-averell/drivers/net/ethertap.c-o	2003-09-11
> > > 04:12:33.000000000 +0200 +++
> > > linux-2.6.0test7mm1-averell/drivers/net/ethertap.c	2003-10-26
> > > 23:41:17.000000000 +0100
> >
> > This part looks good, applied.
>
> I don't know if it actually fixed the bug, I did not test it
> (sorry, should have stated that in the original mail)
> But at least it should printk now instead of crashing.
>
> -Andi

Hi Andi,

Your patch fixed the bug!  Thanks a lot!
I applyed the first hunk as David wrote above.

bye,
        simon.


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

end of thread, other threads:[~2003-10-27 17:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <L1fo.3gb.9@gated-at.bofh.it>
2003-10-26 22:45 ` [2.6.0-test8/9] ethertap oops Andi Kleen
2003-10-27  7:48   ` David S. Miller
2003-10-27 12:26     ` Andi Kleen
2003-10-27 12:22       ` David S. Miller
2003-10-27 17:40       ` Simon Roscic
2003-10-26 22:02 Simon Roscic

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