Netdev List
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	 Sean Anderson <sean.anderson@linux.dev>
Cc: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	 "David S . Miller" <davem@davemloft.net>,
	 Jakub Kicinski <kuba@kernel.org>,
	 Paolo Abeni <pabeni@redhat.com>,
	 netdev@vger.kernel.org,  Willem de Bruijn <willemb@google.com>,
	 linux-kernel@vger.kernel.org,  Shuah Khan <shuah@kernel.org>,
	 linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding
Date: Mon, 09 Sep 2024 13:26:42 -0400	[thread overview]
Message-ID: <66df2fd2d6595_3bff929459@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <CANn89iJaXgR6c+moGB5kX6ATbLX6fMP0mUBQN=SAsZfdz5ywNw@mail.gmail.com>

Eric Dumazet wrote:
> On Mon, Sep 9, 2024 at 5:02 PM Sean Anderson <sean.anderson@linux.dev> wrote:
> >
> > On 9/6/24 22:05, Willem de Bruijn wrote:
> > > Sean Anderson wrote:
> > >> Padding is not included in UDP and TCP checksums. Therefore, reduce the
> > >> length of the checksummed data to include only the data in the IP
> > >> payload. This fixes spurious reported checksum failures like
> > >>
> > >> rx: pkt: sport=33000 len=26 csum=0xc850 verify=0xf9fe
> > >> pkt: bad csum
> > >
> > > Are you using this test as receiver for other input?
> > >
> > > The packet builder in the test doesn't generate these, does it?
> >
> > It's added by the MAC before transmission.
> >
> > This is permitted by the standard, but in this case it actually appears
> > to be due to the MAC using 32-bit reads for the data and not masking off
> > the end. Not sure whether this is a bug in the driver/device, since
> > technically we may leak up to 3 bytes of memory.
> 
> This seems to be a bug in the driver.
> 
> A call to skb_put_padto(skb, ETH_ZLEN) should be added.

In which case this test detecting it may be nice to have, for lack of
a more targeted test.

  reply	other threads:[~2024-09-09 17:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 21:07 [PATCH net] selftests: net: csum: Fix checksums for packets with non-zero padding Sean Anderson
2024-09-07  2:05 ` Willem de Bruijn
2024-09-09 15:02   ` Sean Anderson
2024-09-09 15:06     ` Willem de Bruijn
2024-09-09 15:09     ` Eric Dumazet
2024-09-09 17:26       ` Willem de Bruijn [this message]
2024-09-09 23:51         ` Jakub Kicinski
2024-09-10  1:01           ` Willem de Bruijn
2024-09-10 14:29             ` Sean Anderson
2024-09-10 17:42               ` Willem de Bruijn
2024-09-10 17:52                 ` Sean Anderson
2024-09-10 21:01                   ` Willem de Bruijn
2024-09-11  0:00 ` patchwork-bot+netdevbpf

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=66df2fd2d6595_3bff929459@willemb.c.googlers.com.notmuch \
    --to=willemdebruijn.kernel@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.anderson@linux.dev \
    --cc=shuah@kernel.org \
    --cc=willemb@google.com \
    /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