netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas DICHTEL <nicolas.dichtel@6wind.com>
To: steve@services.navaho.net
Cc: netdev@oss.sgi.com
Subject: Re: More IPSEC trouble
Date: Thu, 10 Mar 2005 16:01:25 +0100	[thread overview]
Message-ID: <42306145.3050603@6wind.com> (raw)
In-Reply-To: <Pine.LNX.4.61.0503101229380.18067@sorbus2.navaho>

When the stack check the mtu for this packet, it doesn't know the size of
the overhead. So the total length of the packet don't include the size
of the esp or ah header. The same bug appears when you run
IPSEC in IPv4 transport mode over a 4in4 tunnel. A fix for this bug
is to allow locally the fragmentation of the packet.

Nicolas Dichtel

Here is a patch:

--- a/linux26/net/ipv4/xfrm4_output.c    Thu Mar 10 15:50:30 2005
+++ b/linux26/net/ipv4/xfrm4_output.c    Thu Mar 10 15:51:49 2005
@@ -116,6 +116,9 @@ int xfrm4_output(struct sk_buff *skb)
 
     xfrm4_encap(skb);
 
+    /* We still allow to fragment this packet locally */
+    skb->local_df = 1;
+   
     err = x->type->output(skb);
     if (err)
         goto error;

Steve Hill wrote:

>
> Unfortunately I've found another IPSEC kernel bug (2.6.10):
>
> Running IPSEC in IPv4 tunnel mode - obviously the packets grow in size 
> when encrypted and when I send a packet that grows to > MTU size when 
> encrypted the machine locks up solid (the packet is generated by a 
> different machine that is routing it via the Linux IPSEC router whcih 
> is having problems).  When it locks up I get no errors from the kernel 
> - it just freezes up solid.
>
> All interfaces have an MTU of 1500 bytes.  The IP address of the 
> machine generating the packet is 10.101.0.42 and the public address of 
> it's ipsec gateway (which is the one locking up) is "a.b.c.d" in the 
> below logging. The VPN server at the other end, also running the 
> 2.6.10 kernel, is w.x.y.z.  The below logging shows a large ICMP 
> packet that produces an MTU-sized encrypted packet and works ok:
>
> $ ping -n 10.254.3.19 -c 1 -s 1372
> PING 10.254.3.19 (10.254.3.19) 1372(1400) bytes of data.
> 1380 bytes from 10.254.3.19: icmp_seq=0 ttl=62 time=94.8 ms
>
> # tcpdump -n -i eth0 proto ICMP -v
> 12:35:50.064417 IP (tos 0x0, ttl  64, id 0, offset 0, flags [DF], 
> proto 1, length: 1400) 10.101.0.42 > 10.254.3.19: icmp 1380: echo 
> request seq 0
>
> # tcpdump -n -i eth1 proto 50 or proto 51 or proto ICMP -v
> 12:28:53.427655 IP (tos 0x0, ttl  64, id 8224, offset 0, flags [DF], 
> proto 51, length: 1500) a.b.c.d > w.x.y.z: 
> AH(spi=0x07260bb2,sumlen=16,seq=0x2d): IP (tos 0x0, ttl  64, id 55247, 
> offset 0, flags [DF], proto 50, length: 1456) a.b.c.d > w.x.y.z: 
> ESP(spi=0x041b1078,seq=0x2d)
>
> Increasing the packet size by 1 byte would obviously require 
> fragmentation of the encrypted packet and causes the machine to lock up.
>
> I will continue to do some debugging but any insight would be 
> appreciated. Thanks.
>
> - Steve Hill (BSc)
> Senior Software Developer                        Email: 
> steve@navaho.co.uk
> Navaho Technologies Ltd.                           Tel: +44-870-7034015
>
>

  reply	other threads:[~2005-03-10 15:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-10 12:45 More IPSEC trouble Steve Hill
2005-03-10 15:01 ` Nicolas DICHTEL [this message]
2005-03-10 16:32   ` Steve Hill
2005-03-10 17:15 ` Patrick McHardy
2005-03-11  1:17 ` Herbert Xu
2005-03-11 15:05   ` Steve Hill
2005-03-12  0:00     ` Patrick McHardy
2005-03-12  0:11       ` Patrick McHardy
2005-03-12  0:13         ` Patrick McHardy
2005-03-12  1:35       ` Herbert Xu
2005-03-12  2:35         ` Patrick McHardy
2005-03-14 12:12         ` Steve Hill
2005-03-15  5:39           ` David S. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42306145.3050603@6wind.com \
    --to=nicolas.dichtel@6wind.com \
    --cc=netdev@oss.sgi.com \
    --cc=steve@services.navaho.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).