Skip to contentSkip to conversation

New: kernel panic with l2tpv3 & mtu > 1500

Bug 47021 Stephen Hemminger 4 participants 7 messages Sep 4, 2012 – Sep 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Begin forwarded message:

Date: Tue, 4 Sep 2012 16:06:06 +0000 (UTC)
From: [email protected]
To: [email protected]
Subject: [Bug 47021] New: kernel panic with l2tpv3 & mtu > 1500

https://bugzilla.kernel.org/show_bug.cgi?id=47021

           Summary: kernel panic with l2tpv3 & mtu > 1500
           Product: Networking
           Version: 2.5
    Kernel Version: 3.2.28
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [email protected]
        Regression: No

first l2tpv3 packet that enters physical device with MTU > 1500 causes kernel panic

tunel created using:

l2tpv3tun add tunnel tunnel_id 1 peer_tunnel_id 1 encap udp udp_sport 5001 udp_dport 5001 local 192.168.1.1 remote 192.168.1.2

l2tpv3tun add session tunnel_id 1 session_id 1 peer_session_id 1 dev l2tpeth1

reproducible: always

Signature · 3 lines
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
#1 lore raw

From: Eric Dumazet <[email protected]>

Quoted 32 lines · Stephen Hemminger

Begin forwarded message:

Date: Tue, 4 Sep 2012 16:06:06 +0000 (UTC)
From: [email protected]
To: [email protected]
Subject: [Bug 47021] New: kernel panic with l2tpv3 & mtu > 1500

https://bugzilla.kernel.org/show_bug.cgi?id=47021

           Summary: kernel panic with l2tpv3 & mtu > 1500
           Product: Networking
           Version: 2.5
    Kernel Version: 3.2.28
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [email protected]
        Regression: No

first l2tpv3 packet that enters physical device with MTU > 1500 causes kernel panic

tunel created using:

Quoted 8 lines

l2tpv3tun add tunnel tunnel_id 1 peer_tunnel_id 1 encap udp udp_sport 5001 udp_dport 5001 local 192.168.1.1 remote 192.168.1.2

l2tpv3tun add session tunnel_id 1 session_id 1 peer_session_id 1 dev l2tpeth1

reproducible: always

Seems following patch is needed, not sure if it helps

[PATCH] l2tp: fix a typo in l2tp_eth_dev_recv()

While investigating l2tp bug, I hit a bug in eth_type_trans(), because not enough bytes were pulled in skb head.

---
 net/l2tp/l2tp_eth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_eth.c +1 -1
index f9ee74d..3bfb34a 100644
@@ -153,7 +153,7 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
 		print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length);
 	}
 
-	if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
+	if (!pskb_may_pull(skb, ETH_HLEN))
 		goto error;
 
 	secpath_reset(skb);
#2 lore raw
Quoted 61 lines · On Tue, 04 Sep 2012 21:52:14 +0200 Eric Dumazet <[email protected]> wrote:

From: Eric Dumazet <[email protected]>

Quoted 32 lines · Stephen Hemminger

Begin forwarded message:

Date: Tue, 4 Sep 2012 16:06:06 +0000 (UTC)
From: [email protected]
To: [email protected]
Subject: [Bug 47021] New: kernel panic with l2tpv3 & mtu > 1500

https://bugzilla.kernel.org/show_bug.cgi?id=47021

           Summary: kernel panic with l2tpv3 & mtu > 1500
           Product: Networking
           Version: 2.5
    Kernel Version: 3.2.28
          Platform: All
        OS/Version: Linux
              Tree: Mainline
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Other
        AssignedTo: [email protected]
        ReportedBy: [email protected]
        Regression: No

first l2tpv3 packet that enters physical device with MTU > 1500 causes kernel panic

tunel created using:

Quoted 8 lines

l2tpv3tun add tunnel tunnel_id 1 peer_tunnel_id 1 encap udp udp_sport 5001 udp_dport 5001 local 192.168.1.1 remote 192.168.1.2

l2tpv3tun add session tunnel_id 1 session_id 1 peer_session_id 1 dev l2tpeth1

reproducible: always

Seems following patch is needed, not sure if it helps

[PATCH] l2tp: fix a typo in l2tp_eth_dev_recv()

While investigating l2tp bug, I hit a bug in eth_type_trans(), because not enough bytes were pulled in skb head.

---
 net/l2tp/l2tp_eth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_eth.c +0 -0
index f9ee74d..3bfb34a 100644

net/l2tp/l2tp_eth.c static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb, · line 157

Quoted 6 lines
net/l2tp/l2tp_eth.c +1 -1
@@ -153,7 +153,7 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
 		print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length);
 	}
 
-	if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
+	if (!pskb_may_pull(skb, ETH_HLEN))
 		goto error;

I guess nobody ever looked inside this code. That seems like an obvious bug.

#4 lore raw
In reply to Stephen Hemminger

Thanks, it definitely helped, no more panics now...

jn

Quoted 28 lines
Quoted 19 lines
Quoted 1 line

Seems following patch is needed, not sure if it helps

[PATCH] l2tp: fix a typo in l2tp_eth_dev_recv()

While investigating l2tp bug, I hit a bug in eth_type_trans(), because not enough bytes were pulled in skb head.

---
 net/l2tp/l2tp_eth.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/l2tp/l2tp_eth.c +0 -0
index f9ee74d..3bfb34a 100644

net/l2tp/l2tp_eth.c static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb, · line 157

Quoted 6 lines
net/l2tp/l2tp_eth.c +1 -1
@@ -153,7 +153,7 @@ static void l2tp_eth_dev_recv(struct l2tp_session *session, struct sk_buff *skb,
 		print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, skb->data, length);
 	}
 
-	if (!pskb_may_pull(skb, sizeof(ETH_HLEN)))
+	if (!pskb_may_pull(skb, ETH_HLEN))
 		goto error;

I guess nobody ever looked inside this code. That seems like an obvious bug.

#5 lore raw
Quoted 1 line · On Wed, 2012-09-05 at 09:45 +0200, a1 wrote:

Thanks, it definitely helped, no more panics now...

It seems MTU of device is wrong, and lot of packets are fragmented...

Its currently 1488, but it really should be less than that (accounting for the IP+UDP header)

I wonder if anybody ever used this code ?