lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+FuTSf0vuRJgxmD=AWRrFRFCr5VeTNfpVWmZvCM2ufuK+tLfw@mail.gmail.com>
Date:   Wed, 19 Feb 2020 22:41:32 -0800
From:   Willem de Bruijn <willemdebruijn.kernel@...il.com>
To:     Jakub Kicinski <kuba@...nel.org>
Cc:     Grygorii Strashko <grygorii.strashko@...com>,
        netdev <netdev@...r.kernel.org>,
        "David S . Miller" <davem@...emloft.net>,
        Alexey Kuznetsov <kuznet@....inr.ac.ru>,
        Eric Dumazet <edumazet@...gle.com>,
        John Fastabend <john.fastabend@...il.com>,
        Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>
Subject: Re: CHECKSUM_COMPLETE question

On Wed, Feb 19, 2020 at 4:26 PM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Wed, 19 Feb 2020 14:59:16 -0800 Willem de Bruijn wrote:
> > On Wed, Feb 19, 2020 at 9:04 AM Grygorii Strashko
> > <grygorii.strashko@...com> wrote:
> > >
> > > Hi All,
> > >
> > > On 12/02/2020 11:52, Grygorii Strashko wrote:
> > > > Hi All,
> > > >
> > > > I'd like to ask expert opinion and clarify few points about HW RX checksum offload.
> > > >
> > > > 1) CHECKSUM_COMPLETE - from description in <linux/skbuff.h>
> > > >   * CHECKSUM_COMPLETE:
> > > >   *
> > > >   *   This is the most generic way. The device supplied checksum of the _whole_
> > > >   *   packet as seen by netif_rx() and fills out in skb->csum. Meaning, the
> > > >   *   hardware doesn't need to parse L3/L4 headers to implement this.
> > > >
> > > > My understanding from above is that HW, to be fully compatible with Linux, should produce CSUM
> > > > starting from first byte after EtherType field:
> > > >   (6 DST_MAC) (6 SRC_MAC) (2 EtherType) (...                   ...)
> > > >                                          ^                       ^
> > > >                                          | start csum            | end csum
> > > > and ending at the last byte of Ethernet frame data.
> > > > - if packet is VLAN tagged then VLAN TCI and real EtherType included in CSUM,
> > > >    but first VLAN TPID doesn't
> > > > - pad bytes may/may not be included in csum
> >
> > Based on commit 88078d98d1bb ("net: pskb_trim_rcsum() and
> > CHECKSUM_COMPLETE are friends") these bytes are expected to be covered
> > by skb->csum.
> >
> > Not sure about that ipv4 header pull without csum adjust.
>
> Isn't it just because IPv4 has a header checksum and therefore what's
> pulled off adds up to 0 anyway? IPv6 does not have a header csum, hence
> the adjustment?

Ah yes, of course!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ