netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: aduyck@mirantis.com
Cc: netdev@vger.kernel.org, alexander.duyck@gmail.com
Subject: Re: [net-next PATCH] IPv6: Use a 16 bit length field when computing a IPv6 UDP checksum
Date: Tue, 01 Mar 2016 15:09:02 -0500 (EST)	[thread overview]
Message-ID: <20160301.150902.257372984527759080.davem@davemloft.net> (raw)
In-Reply-To: <20160226025738.16760.41163.stgit@localhost.localdomain>

From: Alexander Duyck <aduyck@mirantis.com>
Date: Thu, 25 Feb 2016 19:10:59 -0800

> This change makes it so that we only use a 16 bit length field instead of a
> 32 bit length field when computing a UDP checksum for IPv6.
> 
> This fixes an issue found with UDP tunnels over IPv6 where the total size
> exceeded 65536 for a frame that was to be segmented.  As a result the
> checksum being computed didn't match the frame data so we ended up being
> off by 1 for the final checksum value since we didn't cancel out the upper
> 16 bits of the length.
> 
> The reasoning behind this is that RFC2460 states that for protocols such as
> UDP that carry their own length field we should use that when computing the
> checksum for the pseudo-header.  As such we should be using a 16 bit value,
> not a 32 bit as is currently occurring when computing the UDP checksum for
> IPv6.
> 
> Signed-off-by: Alexander Duyck <aduyck@mirantis.com>

What a can of worms. :-/

Reading RFC2460 over a few times, indeed using the truncated 16-bit length
is the thing to do for the pseudo-header checksum.

We have this mistake in a few places, for example ip6_compute_pseudo()
unconditionally uses skb->len, yet is used by UDP on receive.

Can you do a little audit and fix as many of these cases as you can find
and wrap them all into this patch?

Thanks!

  reply	other threads:[~2016-03-01 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-26  3:10 [net-next PATCH] IPv6: Use a 16 bit length field when computing a IPv6 UDP checksum Alexander Duyck
2016-03-01 20:09 ` David Miller [this message]
2016-03-01 21:19   ` Alexander Duyck
2016-03-01 21:35     ` David Miller
2016-03-01 22:26       ` Alexander Duyck

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=20160301.150902.257372984527759080.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=aduyck@mirantis.com \
    --cc=alexander.duyck@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).