All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel >= 4.0: crashes when using traceroute6 with isatap
@ 2015-05-02  0:16 Wolfgang Walter
  2015-05-02 12:29 ` Wolfgang Walter
       [not found] ` <1431002384.22756.0.camel@edumazet-glaptop2.roam.corp.google.com>
  0 siblings, 2 replies; 18+ messages in thread
From: Wolfgang Walter @ 2015-05-02  0:16 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hannes Frederic Sowa

[-- Attachment #1: Type: text/plain, Size: 305 bytes --]

Hello,

kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an 
isatap-tunnel.

I took an image of the message I got. It is not complete as my vt has not 
enough lines.

3.19.3 works fine.

Regards,
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

[-- Attachment #2: crash.jpeg --]
[-- Type: image/jpeg, Size: 51041 bytes --]

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-02  0:16 kernel >= 4.0: crashes when using traceroute6 with isatap Wolfgang Walter
@ 2015-05-02 12:29 ` Wolfgang Walter
  2015-05-06 18:15   ` Cong Wang
       [not found] ` <1431002384.22756.0.camel@edumazet-glaptop2.roam.corp.google.com>
  1 sibling, 1 reply; 18+ messages in thread
From: Wolfgang Walter @ 2015-05-02 12:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hannes Frederic Sowa

Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> Hello,
> 
> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
> isatap-tunnel.

I did some further tests. To trigger the crash you need

* isatap-tunnel (probably any sit-tunnel will do it)
* raw-socket
* udp

Using icmpv6 or tcp i.e. does not trigger it.

> 
> I took an image of the message I got. It is not complete as my vt has not
> enough lines.
> 
> 3.19.3 works fine.
> 
> Regards,

Regards,
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-02 12:29 ` Wolfgang Walter
@ 2015-05-06 18:15   ` Cong Wang
  2015-05-06 19:10     ` Eric Dumazet
  2015-05-06 22:11     ` Wolfgang Walter
  0 siblings, 2 replies; 18+ messages in thread
From: Cong Wang @ 2015-05-06 18:15 UTC (permalink / raw)
  To: Wolfgang Walter
  Cc: LKML, Hannes Frederic Sowa, Linux Kernel Network Developers

(Cc'ing netdev.)

On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
>> Hello,
>>
>> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
>> isatap-tunnel.
>
> I did some further tests. To trigger the crash you need
>
> * isatap-tunnel (probably any sit-tunnel will do it)
> * raw-socket
> * udp
>
> Using icmpv6 or tcp i.e. does not trigger it.
>

Do you have a script to reproduce it?


Thanks for the bug report!

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 18:15   ` Cong Wang
@ 2015-05-06 19:10     ` Eric Dumazet
  2015-05-06 22:04       ` Wolfgang Walter
  2015-05-06 22:11     ` Wolfgang Walter
  1 sibling, 1 reply; 18+ messages in thread
From: Eric Dumazet @ 2015-05-06 19:10 UTC (permalink / raw)
  To: Cong Wang, Vlad Yasevich
  Cc: Wolfgang Walter, LKML, Hannes Frederic Sowa,
	Linux Kernel Network Developers

On Wed, 2015-05-06 at 11:15 -0700, Cong Wang wrote:
> (Cc'ing netdev.)
> 
> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> > Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> >> Hello,
> >>
> >> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
> >> isatap-tunnel.
> >
> > I did some further tests. To trigger the crash you need
> >
> > * isatap-tunnel (probably any sit-tunnel will do it)
> > * raw-socket
> > * udp
> >
> > Using icmpv6 or tcp i.e. does not trigger it.
> >
> 
> Do you have a script to reproduce it?
> 
> 
> Thanks for the bug report!
> --

Please Wolfgang try to revert 32dce968dd987adfb0c00946d78dad9154f64759
("ipv6: Allow for partial checksums on non-ufo packets")



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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 19:10     ` Eric Dumazet
@ 2015-05-06 22:04       ` Wolfgang Walter
  2015-05-06 22:42         ` Eric Dumazet
  0 siblings, 1 reply; 18+ messages in thread
From: Wolfgang Walter @ 2015-05-06 22:04 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Cong Wang, Vlad Yasevich, LKML, Hannes Frederic Sowa,
	Linux Kernel Network Developers

Am Mittwoch, 6. Mai 2015, 12:10:00 schrieb Eric Dumazet:
> On Wed, 2015-05-06 at 11:15 -0700, Cong Wang wrote:
> > (Cc'ing netdev.)
> > 
> > On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> > > Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> > >> Hello,
> > >> 
> > >> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with
> > >> an
> > >> isatap-tunnel.
> > > 
> > > I did some further tests. To trigger the crash you need
> > > 
> > > * isatap-tunnel (probably any sit-tunnel will do it)
> > > * raw-socket
> > > * udp
> > > 
> > > Using icmpv6 or tcp i.e. does not trigger it.
> > 
> > Do you have a script to reproduce it?
> > 
> > 
> > Thanks for the bug report!
> > --
> 
> Please Wolfgang try to revert 32dce968dd987adfb0c00946d78dad9154f64759
> ("ipv6: Allow for partial checksums on non-ufo packets")

Indeed, that fixes the problem.

Regards
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 18:15   ` Cong Wang
  2015-05-06 19:10     ` Eric Dumazet
@ 2015-05-06 22:11     ` Wolfgang Walter
  2015-05-12 20:18       ` Vlad Yasevich
  1 sibling, 1 reply; 18+ messages in thread
From: Wolfgang Walter @ 2015-05-06 22:11 UTC (permalink / raw)
  To: Cong Wang; +Cc: LKML, Hannes Frederic Sowa, Linux Kernel Network Developers

Am Mittwoch, 6. Mai 2015, 11:15:18 schrieben Sie:
> (Cc'ing netdev.)
> 
> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> > Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> >> Hello,
> >> 
> >> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
> >> isatap-tunnel.
> > 
> > I did some further tests. To trigger the crash you need
> > 
> > * isatap-tunnel (probably any sit-tunnel will do it)
> > * raw-socket
> > * udp
> > 
> > Using icmpv6 or tcp i.e. does not trigger it.
> 
> Do you have a script to reproduce it?
> 
> 
> Thanks for the bug report!

You need a isatap-server with say ipv4-address $X

Then, on host with 4.0, start isatapd: isatapd --mtu 1280 $X 

then do

	traceroute6 www.google.de

Regards,
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 22:04       ` Wolfgang Walter
@ 2015-05-06 22:42         ` Eric Dumazet
  2015-05-07  0:04           ` Wolfgang Walter
  2015-05-12 16:34           ` Vlad Yasevich
  0 siblings, 2 replies; 18+ messages in thread
From: Eric Dumazet @ 2015-05-06 22:42 UTC (permalink / raw)
  To: Wolfgang Walter
  Cc: Cong Wang, Vlad Yasevich, LKML, Hannes Frederic Sowa,
	Linux Kernel Network Developers

On Thu, 2015-05-07 at 00:04 +0200, Wolfgang Walter wrote:
> Am Mittwoch, 6. Mai 2015, 12:10:00 schrieb Eric Dumazet:
> > On Wed, 2015-05-06 at 11:15 -0700, Cong Wang wrote:
> > > (Cc'ing netdev.)
> > > 
> > > On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> > > > Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> > > >> Hello,
> > > >> 
> > > >> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with
> > > >> an
> > > >> isatap-tunnel.
> > > > 
> > > > I did some further tests. To trigger the crash you need
> > > > 
> > > > * isatap-tunnel (probably any sit-tunnel will do it)
> > > > * raw-socket
> > > > * udp
> > > > 
> > > > Using icmpv6 or tcp i.e. does not trigger it.
> > > 
> > > Do you have a script to reproduce it?
> > > 
> > > 
> > > Thanks for the bug report!
> > > --
> > 
> > Please Wolfgang try to revert 32dce968dd987adfb0c00946d78dad9154f64759
> > ("ipv6: Allow for partial checksums on non-ufo packets")
> 
> Indeed, that fixes the problem.

Yes, setting skb->csum to 0 is clearly wrong for CHECKSUM_PARTIAL

Would you try :

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7fde1f265c90e90f16291e6c861b6e242111c25b..694ae630e1ca67e25ab1e5f6dd0b3597db3669b0 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1416,6 +1416,10 @@ alloc_new_skb:
 			data += fragheaderlen;
 			skb->transport_header = (skb->network_header +
 						 fragheaderlen);
+			if (csummode == CHECKSUM_PARTIAL) {
+				skb->csum_start = skb_transport_header(skb) - skb->head;
+				skb->csum_offset = offsetof(struct udphdr, check);
+			}
 			if (fraggap) {
 				skb->csum = skb_copy_and_csum_bits(
 					skb_prev, maxfraglen,




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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 22:42         ` Eric Dumazet
@ 2015-05-07  0:04           ` Wolfgang Walter
  2015-05-12 16:34           ` Vlad Yasevich
  1 sibling, 0 replies; 18+ messages in thread
From: Wolfgang Walter @ 2015-05-07  0:04 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Cong Wang, Vlad Yasevich, LKML, Hannes Frederic Sowa,
	Linux Kernel Network Developers

Am Mittwoch, 6. Mai 2015, 15:42:38 schrieben Sie:
> On Thu, 2015-05-07 at 00:04 +0200, Wolfgang Walter wrote:
> > Am Mittwoch, 6. Mai 2015, 12:10:00 schrieb Eric Dumazet:
> > > On Wed, 2015-05-06 at 11:15 -0700, Cong Wang wrote:
> > > > (Cc'ing netdev.)
> > > > 
> > > > On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> > > > > Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> > > > >> Hello,
> > > > >> 
> > > > >> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6
> > > > >> with
> > > > >> an
> > > > >> isatap-tunnel.
> > > > > 
> > > > > I did some further tests. To trigger the crash you need
> > > > > 
> > > > > * isatap-tunnel (probably any sit-tunnel will do it)
> > > > > * raw-socket
> > > > > * udp
> > > > > 
> > > > > Using icmpv6 or tcp i.e. does not trigger it.
> > > > 
> > > > Do you have a script to reproduce it?
> > > > 
> > > > 
> > > > Thanks for the bug report!
> > > > --
> > > 
> > > Please Wolfgang try to revert 32dce968dd987adfb0c00946d78dad9154f64759
> > > ("ipv6: Allow for partial checksums on non-ufo packets")
> > 
> > Indeed, that fixes the problem.
> 
> Yes, setting skb->csum to 0 is clearly wrong for CHECKSUM_PARTIAL
> 
> Would you try :
> 
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index
> 7fde1f265c90e90f16291e6c861b6e242111c25b..694ae630e1ca67e25ab1e5f6dd0b3597d
> b3669b0 100644 --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1416,6 +1416,10 @@ alloc_new_skb:
>  			data += fragheaderlen;
>  			skb->transport_header = (skb->network_header +
>  						 fragheaderlen);
> +			if (csummode == CHECKSUM_PARTIAL) {
> +				skb->csum_start = skb_transport_header(skb) - skb->head;
> +				skb->csum_offset = offsetof(struct udphdr, check);
> +			}
>  			if (fraggap) {
>  				skb->csum = skb_copy_and_csum_bits(
>  					skb_prev, maxfraglen,

This patch fixes 4.0.1 (and 4.0.2).

Thanks Eric,
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

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

* [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets"
       [not found]       ` <1431122268.22756.41.camel@edumazet-glaptop2.roam.corp.google.com>
@ 2015-05-08 22:22         ` Eric Dumazet
  2015-05-10 23:53           ` David Miller
  2015-05-12 18:05           ` Vlad Yasevich
  0 siblings, 2 replies; 18+ messages in thread
From: Eric Dumazet @ 2015-05-08 22:22 UTC (permalink / raw)
  To: Wolfgang Walter; +Cc: Vlad Yasevich, netdev

From: Eric Dumazet <edumazet@google.com>

Wolfgang Walter reported crashes using traceroute6, root caused to this
commit.

UDP packets can be sent from RAW sockets.

Note that the faulty commit addressed a non problem, as normal
UDP v6 packets use udp_v6_send_skb() which correctly setup
CHECKSUM_PARTIAL properly if device has the correct feature.

It seems not worth trying to 'fix' the raw path.

Fixes: 32dce968dd98 ("ipv6: Allow for partial checksums on non-ufo packets")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Wolfgang Walter <linux@stwm.de>
Cc: Vlad Yasevich <vyasevich@gmail.com>
---
 net/ipv6/ip6_output.c |   11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7fde1f265c90..1fe5c687328e 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1218,7 +1218,6 @@ static int __ip6_append_data(struct sock *sk,
 	u32 tskey = 0;
 	struct rt6_info *rt = (struct rt6_info *)cork->dst;
 	struct ipv6_txoptions *opt = v6_cork->opt;
-	int csummode = CHECKSUM_NONE;
 
 	skb = skb_peek_tail(queue);
 	if (!skb) {
@@ -1275,14 +1274,6 @@ emsgsize:
 			tskey = sk->sk_tskey++;
 	}
 
-	/* If this is the first and only packet and device
-	 * supports checksum offloading, let's use it.
-	 */
-	if (!skb && sk->sk_protocol == IPPROTO_UDP &&
-	    length + fragheaderlen < mtu &&
-	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
-	    !exthdrlen)
-		csummode = CHECKSUM_PARTIAL;
 	/*
 	 * Let's try using as much space as possible.
 	 * Use MTU if total length of the message fits into the MTU.
@@ -1396,7 +1387,7 @@ alloc_new_skb:
 			 *	Fill in the control structures
 			 */
 			skb->protocol = htons(ETH_P_IPV6);
-			skb->ip_summed = csummode;
+			skb->ip_summed = CHECKSUM_NONE;
 			skb->csum = 0;
 			/* reserve for fragmentation and ipsec header */
 			skb_reserve(skb, hh_len + sizeof(struct frag_hdr) +

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

* Re: [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets"
  2015-05-08 22:22         ` [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets" Eric Dumazet
@ 2015-05-10 23:53           ` David Miller
  2015-05-12 18:05           ` Vlad Yasevich
  1 sibling, 0 replies; 18+ messages in thread
From: David Miller @ 2015-05-10 23:53 UTC (permalink / raw)
  To: eric.dumazet; +Cc: linux, vyasevich, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 08 May 2015 15:22:45 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> Wolfgang Walter reported crashes using traceroute6, root caused to this
> commit.
> 
> UDP packets can be sent from RAW sockets.
> 
> Note that the faulty commit addressed a non problem, as normal
> UDP v6 packets use udp_v6_send_skb() which correctly setup
> CHECKSUM_PARTIAL properly if device has the correct feature.
> 
> It seems not worth trying to 'fix' the raw path.
> 
> Fixes: 32dce968dd98 ("ipv6: Allow for partial checksums on non-ufo packets")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Wolfgang Walter <linux@stwm.de>

Vlad, please review this.

Thanks.

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 22:42         ` Eric Dumazet
  2015-05-07  0:04           ` Wolfgang Walter
@ 2015-05-12 16:34           ` Vlad Yasevich
  1 sibling, 0 replies; 18+ messages in thread
From: Vlad Yasevich @ 2015-05-12 16:34 UTC (permalink / raw)
  To: Eric Dumazet, Wolfgang Walter
  Cc: Cong Wang, LKML, Hannes Frederic Sowa, Linux Kernel Network Developers

On 05/06/2015 06:42 PM, Eric Dumazet wrote:
> On Thu, 2015-05-07 at 00:04 +0200, Wolfgang Walter wrote:
>> Am Mittwoch, 6. Mai 2015, 12:10:00 schrieb Eric Dumazet:
>>> On Wed, 2015-05-06 at 11:15 -0700, Cong Wang wrote:
>>>> (Cc'ing netdev.)
>>>>
>>>> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
>>>>> Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
>>>>>> Hello,
>>>>>>
>>>>>> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with
>>>>>> an
>>>>>> isatap-tunnel.
>>>>>
>>>>> I did some further tests. To trigger the crash you need
>>>>>
>>>>> * isatap-tunnel (probably any sit-tunnel will do it)
>>>>> * raw-socket
>>>>> * udp
>>>>>
>>>>> Using icmpv6 or tcp i.e. does not trigger it.
>>>>
>>>> Do you have a script to reproduce it?
>>>>
>>>>
>>>> Thanks for the bug report!
>>>> --
>>>
>>> Please Wolfgang try to revert 32dce968dd987adfb0c00946d78dad9154f64759
>>> ("ipv6: Allow for partial checksums on non-ufo packets")
>>
>> Indeed, that fixes the problem.
> 
> Yes, setting skb->csum to 0 is clearly wrong for CHECKSUM_PARTIAL
> 
> Would you try :
> 
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 7fde1f265c90e90f16291e6c861b6e242111c25b..694ae630e1ca67e25ab1e5f6dd0b3597db3669b0 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1416,6 +1416,10 @@ alloc_new_skb:
>  			data += fragheaderlen;
>  			skb->transport_header = (skb->network_header +
>  						 fragheaderlen);
> +			if (csummode == CHECKSUM_PARTIAL) {
> +				skb->csum_start = skb_transport_header(skb) - skb->head;
> +				skb->csum_offset = offsetof(struct udphdr, check);
> +			}
>  			if (fraggap) {
>  				skb->csum = skb_copy_and_csum_bits(
>  					skb_prev, maxfraglen,
> 
> 
> 

So why is this not an issue in __ip_append_data()?

-vlad


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

* Re: [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets"
  2015-05-08 22:22         ` [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets" Eric Dumazet
  2015-05-10 23:53           ` David Miller
@ 2015-05-12 18:05           ` Vlad Yasevich
  2015-05-12 19:07             ` Eric Dumazet
  1 sibling, 1 reply; 18+ messages in thread
From: Vlad Yasevich @ 2015-05-12 18:05 UTC (permalink / raw)
  To: Eric Dumazet, Wolfgang Walter; +Cc: netdev

On 05/08/2015 06:22 PM, Eric Dumazet wrote:
> From: Eric Dumazet <edumazet@google.com>
> 
> Wolfgang Walter reported crashes using traceroute6, root caused to this
> commit.
> 
> UDP packets can be sent from RAW sockets.
> 
> Note that the faulty commit addressed a non problem, as normal
> UDP v6 packets use udp_v6_send_skb() which correctly setup
> CHECKSUM_PARTIAL properly if device has the correct feature.

Actually, they didn't.  udp_v6_send_skb() uses ip_summed from
the skb, which is populated by __ip6_append_data.  That in turn
always set it CHECKSUM_NONE.

The code in question looks identically to that of __ip_append_data().
The problem is similar in both places.

-vlad
> 
> It seems not worth trying to 'fix' the raw path.
> 
> Fixes: 32dce968dd98 ("ipv6: Allow for partial checksums on non-ufo packets")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Wolfgang Walter <linux@stwm.de>
> Cc: Vlad Yasevich <vyasevich@gmail.com>
> ---
>  net/ipv6/ip6_output.c |   11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 7fde1f265c90..1fe5c687328e 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1218,7 +1218,6 @@ static int __ip6_append_data(struct sock *sk,
>  	u32 tskey = 0;
>  	struct rt6_info *rt = (struct rt6_info *)cork->dst;
>  	struct ipv6_txoptions *opt = v6_cork->opt;
> -	int csummode = CHECKSUM_NONE;
>  
>  	skb = skb_peek_tail(queue);
>  	if (!skb) {
> @@ -1275,14 +1274,6 @@ emsgsize:
>  			tskey = sk->sk_tskey++;
>  	}
>  
> -	/* If this is the first and only packet and device
> -	 * supports checksum offloading, let's use it.
> -	 */
> -	if (!skb && sk->sk_protocol == IPPROTO_UDP &&
> -	    length + fragheaderlen < mtu &&
> -	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
> -	    !exthdrlen)
> -		csummode = CHECKSUM_PARTIAL;
>  	/*
>  	 * Let's try using as much space as possible.
>  	 * Use MTU if total length of the message fits into the MTU.
> @@ -1396,7 +1387,7 @@ alloc_new_skb:
>  			 *	Fill in the control structures
>  			 */
>  			skb->protocol = htons(ETH_P_IPV6);
> -			skb->ip_summed = csummode;
> +			skb->ip_summed = CHECKSUM_NONE;
>  			skb->csum = 0;
>  			/* reserve for fragmentation and ipsec header */
>  			skb_reserve(skb, hh_len + sizeof(struct frag_hdr) +
> 
> 

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

* Re: [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets"
  2015-05-12 18:05           ` Vlad Yasevich
@ 2015-05-12 19:07             ` Eric Dumazet
  0 siblings, 0 replies; 18+ messages in thread
From: Eric Dumazet @ 2015-05-12 19:07 UTC (permalink / raw)
  To: Vlad Yasevich; +Cc: Wolfgang Walter, netdev

On Tue, 2015-05-12 at 14:05 -0400, Vlad Yasevich wrote:
> On 05/08/2015 06:22 PM, Eric Dumazet wrote:
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > Wolfgang Walter reported crashes using traceroute6, root caused to this
> > commit.
> > 
> > UDP packets can be sent from RAW sockets.
> > 
> > Note that the faulty commit addressed a non problem, as normal
> > UDP v6 packets use udp_v6_send_skb() which correctly setup
> > CHECKSUM_PARTIAL properly if device has the correct feature.
> 
> Actually, they didn't.  udp_v6_send_skb() uses ip_summed from
> the skb, which is populated by __ip6_append_data.  That in turn
> always set it CHECKSUM_NONE.
> 
> The code in question looks identically to that of __ip_append_data().
> The problem is similar in both places.

Well, one is crashing the host. IPv4 raw must have been OK, not IPv6.

As I explained in the changelog, you can try to fix
rawv6_push_pending_frames()

My opinion is that a reasonable strategy is to revert for stable
kernels.

Then if you can fix rawv6_push_pending_frames() for net-next, I will be
happy to review your patch.

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-06 22:11     ` Wolfgang Walter
@ 2015-05-12 20:18       ` Vlad Yasevich
  2015-05-12 20:36         ` Eric Dumazet
  2015-05-14  0:32         ` Wolfgang Walter
  0 siblings, 2 replies; 18+ messages in thread
From: Vlad Yasevich @ 2015-05-12 20:18 UTC (permalink / raw)
  To: Wolfgang Walter, Cong Wang
  Cc: LKML, Hannes Frederic Sowa, Linux Kernel Network Developers

On 05/06/2015 06:11 PM, Wolfgang Walter wrote:
> Am Mittwoch, 6. Mai 2015, 11:15:18 schrieben Sie:
>> (Cc'ing netdev.)
>>
>> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
>>> Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
>>>> Hello,
>>>>
>>>> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
>>>> isatap-tunnel.
>>>
>>> I did some further tests. To trigger the crash you need
>>>
>>> * isatap-tunnel (probably any sit-tunnel will do it)
>>> * raw-socket
>>> * udp
>>>
>>> Using icmpv6 or tcp i.e. does not trigger it.
>>
>> Do you have a script to reproduce it?
>>
>>
>> Thanks for the bug report!
>
> You need a isatap-server with say ipv4-address $X
>
> Then, on host with 4.0, start isatapd: isatapd --mtu 1280 $X
>
> then do
>
> 	traceroute6 www.google.de
>
> Regards,
>

Hi Walter

Could you try this patch.  Looks like raw passes transhdrlen
of 0 on the first packet and that makes IPv4 behave correctly,
but not IPv6.


diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 7fde1f2..fd9c079 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1278,7 +1278,7 @@ emsgsize:
 	/* If this is the first and only packet and device
 	 * supports checksum offloading, let's use it.
 	 */
-	if (!skb && sk->sk_protocol == IPPROTO_UDP &&
+	if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&
 	    length + fragheaderlen < mtu &&
 	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
 	    !exthdrlen)

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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-12 20:18       ` Vlad Yasevich
@ 2015-05-12 20:36         ` Eric Dumazet
  2015-05-12 20:46           ` Vlad Yasevich
  2015-05-14  0:32         ` Wolfgang Walter
  1 sibling, 1 reply; 18+ messages in thread
From: Eric Dumazet @ 2015-05-12 20:36 UTC (permalink / raw)
  To: Vlad Yasevich
  Cc: Wolfgang Walter, Cong Wang, LKML, Hannes Frederic Sowa,
	Linux Kernel Network Developers

On Tue, 2015-05-12 at 16:18 -0400, Vlad Yasevich wrote:
> On 05/06/2015 06:11 PM, Wolfgang Walter wrote:
> > Am Mittwoch, 6. Mai 2015, 11:15:18 schrieben Sie:
> >> (Cc'ing netdev.)
> >>
> >> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> >>> Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> >>>> Hello,
> >>>>
> >>>> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
> >>>> isatap-tunnel.
> >>>
> >>> I did some further tests. To trigger the crash you need
> >>>
> >>> * isatap-tunnel (probably any sit-tunnel will do it)
> >>> * raw-socket
> >>> * udp
> >>>
> >>> Using icmpv6 or tcp i.e. does not trigger it.
> >>
> >> Do you have a script to reproduce it?
> >>
> >>
> >> Thanks for the bug report!
> >
> > You need a isatap-server with say ipv4-address $X
> >
> > Then, on host with 4.0, start isatapd: isatapd --mtu 1280 $X
> >
> > then do
> >
> > 	traceroute6 www.google.de
> >
> > Regards,
> >
> 
> Hi Walter
> 
> Could you try this patch.  Looks like raw passes transhdrlen
> of 0 on the first packet and that makes IPv4 behave correctly,
> but not IPv6.
> 
> 
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 7fde1f2..fd9c079 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1278,7 +1278,7 @@ emsgsize:
>  	/* If this is the first and only packet and device
>  	 * supports checksum offloading, let's use it.
>  	 */
> -	if (!skb && sk->sk_protocol == IPPROTO_UDP &&
> +	if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&
>  	    length + fragheaderlen < mtu &&
>  	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
>  	    !exthdrlen)

And make sure the checksum is correct ;)

Vlad, can you tell where skb->cum_start and skb->csum_offset are set ?




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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-12 20:36         ` Eric Dumazet
@ 2015-05-12 20:46           ` Vlad Yasevich
  0 siblings, 0 replies; 18+ messages in thread
From: Vlad Yasevich @ 2015-05-12 20:46 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Wolfgang Walter, Cong Wang, LKML, Hannes Frederic Sowa,
	Linux Kernel Network Developers

On 05/12/2015 04:36 PM, Eric Dumazet wrote:
> On Tue, 2015-05-12 at 16:18 -0400, Vlad Yasevich wrote:
>> On 05/06/2015 06:11 PM, Wolfgang Walter wrote:
>>> Am Mittwoch, 6. Mai 2015, 11:15:18 schrieben Sie:
>>>> (Cc'ing netdev.)
>>>>
>>>> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
>>>>> Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
>>>>>> Hello,
>>>>>>
>>>>>> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
>>>>>> isatap-tunnel.
>>>>>
>>>>> I did some further tests. To trigger the crash you need
>>>>>
>>>>> * isatap-tunnel (probably any sit-tunnel will do it)
>>>>> * raw-socket
>>>>> * udp
>>>>>
>>>>> Using icmpv6 or tcp i.e. does not trigger it.
>>>>
>>>> Do you have a script to reproduce it?
>>>>
>>>>
>>>> Thanks for the bug report!
>>>
>>> You need a isatap-server with say ipv4-address $X
>>>
>>> Then, on host with 4.0, start isatapd: isatapd --mtu 1280 $X
>>>
>>> then do
>>>
>>> 	traceroute6 www.google.de
>>>
>>> Regards,
>>>
>>
>> Hi Walter
>>
>> Could you try this patch.  Looks like raw passes transhdrlen
>> of 0 on the first packet and that makes IPv4 behave correctly,
>> but not IPv6.
>>
>>
>> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
>> index 7fde1f2..fd9c079 100644
>> --- a/net/ipv6/ip6_output.c
>> +++ b/net/ipv6/ip6_output.c
>> @@ -1278,7 +1278,7 @@ emsgsize:
>>  	/* If this is the first and only packet and device
>>  	 * supports checksum offloading, let's use it.
>>  	 */
>> -	if (!skb && sk->sk_protocol == IPPROTO_UDP &&
>> +	if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&
>>  	    length + fragheaderlen < mtu &&
>>  	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
>>  	    !exthdrlen)
> 
> And make sure the checksum is correct ;)
> 
> Vlad, can you tell where skb->cum_start and skb->csum_offset are set ?
> 
> 

For udp, udp6_hwcsum_outgoing(), but with the above patch, the check above will return
false, and we'll fallback to using CHECKSUM_NONE.

Before, the !skb was true since there there was no skb on the queue.  Now, that
we are checking transhdr and raw passing in 0, the check will be false.  This
is what's making IPv4 work correctly in this case.

-vlad


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

* Re: kernel >= 4.0: crashes when using traceroute6 with isatap
  2015-05-12 20:18       ` Vlad Yasevich
  2015-05-12 20:36         ` Eric Dumazet
@ 2015-05-14  0:32         ` Wolfgang Walter
  1 sibling, 0 replies; 18+ messages in thread
From: Wolfgang Walter @ 2015-05-14  0:32 UTC (permalink / raw)
  To: Vlad Yasevich
  Cc: Cong Wang, LKML, Hannes Frederic Sowa, Linux Kernel Network Developers

Am Dienstag, 12. Mai 2015, 16:18:54 schrieb Vlad Yasevich:
> On 05/06/2015 06:11 PM, Wolfgang Walter wrote:
> > Am Mittwoch, 6. Mai 2015, 11:15:18 schrieben Sie:
> >> (Cc'ing netdev.)
> >> 
> >> On Sat, May 2, 2015 at 5:29 AM, Wolfgang Walter <linux@stwm.de> wrote:
> >>> Am Samstag, 2. Mai 2015, 02:16:36 schrieb Wolfgang Walter:
> >>>> Hello,
> >>>> 
> >>>> kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with
> >>>> an
> >>>> isatap-tunnel.
> >>> 
> >>> I did some further tests. To trigger the crash you need
> >>> 
> >>> * isatap-tunnel (probably any sit-tunnel will do it)
> >>> * raw-socket
> >>> * udp
> >>> 
> >>> Using icmpv6 or tcp i.e. does not trigger it.
> >> 
> >> Do you have a script to reproduce it?
> >> 
> >> 
> >> Thanks for the bug report!
> > 
> > You need a isatap-server with say ipv4-address $X
> > 
> > Then, on host with 4.0, start isatapd: isatapd --mtu 1280 $X
> > 
> > then do
> > 
> > 	traceroute6 www.google.de
> > 
> > Regards,
> 
> Hi Walter
> 
> Could you try this patch.  Looks like raw passes transhdrlen
> of 0 on the first packet and that makes IPv4 behave correctly,
> but not IPv6.
> 
> 
> diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
> index 7fde1f2..fd9c079 100644
> --- a/net/ipv6/ip6_output.c
> +++ b/net/ipv6/ip6_output.c
> @@ -1278,7 +1278,7 @@ emsgsize:
>  	/* If this is the first and only packet and device
>  	 * supports checksum offloading, let's use it.
>  	 */
> -	if (!skb && sk->sk_protocol == IPPROTO_UDP &&
> +	if (transhdrlen && sk->sk_protocol == IPPROTO_UDP &&
>  	    length + fragheaderlen < mtu &&
>  	    rt->dst.dev->features & NETIF_F_V6_CSUM &&
>  	    !exthdrlen)

Ok, that works as fix. No crash and checksums are ok.

Regards,
-- 
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

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

* kernel >= 4.0: crashes when using traceroute6 with isatap
@ 2015-05-06 18:14 Cong Wang
  0 siblings, 0 replies; 18+ messages in thread
From: Cong Wang @ 2015-05-06 18:14 UTC (permalink / raw)
  To: Wolfgang Walter; +Cc: Linux Kernel Network Developers

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

(Please always Cc netdev for networking bugs.)


---------- Forwarded message ----------
From: Wolfgang Walter <linux@stwm.de>
Date: Fri, May 1, 2015 at 5:16 PM
Subject: kernel >= 4.0: crashes when using traceroute6 with isatap
To: linux-kernel@vger.kernel.org
Cc: Hannes Frederic Sowa <hannes@stressinduktion.org>


Hello,

kernel 4.0 (and 4.0.1) crashes immediately when I use traceroute6 with an
isatap-tunnel.

I took an image of the message I got. It is not complete as my vt has not
enough lines.

3.19.3 works fine.

Regards,
--
Wolfgang Walter
Studentenwerk München
Anstalt des öffentlichen Rechts

[-- Attachment #2: crash.jpeg --]
[-- Type: image/jpeg, Size: 51041 bytes --]

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

end of thread, other threads:[~2015-05-14  0:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-02  0:16 kernel >= 4.0: crashes when using traceroute6 with isatap Wolfgang Walter
2015-05-02 12:29 ` Wolfgang Walter
2015-05-06 18:15   ` Cong Wang
2015-05-06 19:10     ` Eric Dumazet
2015-05-06 22:04       ` Wolfgang Walter
2015-05-06 22:42         ` Eric Dumazet
2015-05-07  0:04           ` Wolfgang Walter
2015-05-12 16:34           ` Vlad Yasevich
2015-05-06 22:11     ` Wolfgang Walter
2015-05-12 20:18       ` Vlad Yasevich
2015-05-12 20:36         ` Eric Dumazet
2015-05-12 20:46           ` Vlad Yasevich
2015-05-14  0:32         ` Wolfgang Walter
     [not found] ` <1431002384.22756.0.camel@edumazet-glaptop2.roam.corp.google.com>
     [not found]   ` <12346713.ZyFExCo3ux@h2o.as.studentenwerk.mhn.de>
     [not found]     ` <2088438.42IY8hjjd5@h2o.as.studentenwerk.mhn.de>
     [not found]       ` <1431122268.22756.41.camel@edumazet-glaptop2.roam.corp.google.com>
2015-05-08 22:22         ` [PATCH net] Revert "ipv6: Allow for partial checksums on non-ufo packets" Eric Dumazet
2015-05-10 23:53           ` David Miller
2015-05-12 18:05           ` Vlad Yasevich
2015-05-12 19:07             ` Eric Dumazet
2015-05-06 18:14 kernel >= 4.0: crashes when using traceroute6 with isatap Cong Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.