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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALx6S37xYJAWbpV1f7V0F3d8XKTwWt7sDQLt8hhawwiBzqXLUg@mail.gmail.com>
Date:   Mon, 28 Jan 2019 20:01:53 -0800
From:   Tom Herbert <tom@...bertland.com>
To:     maowenan <maowenan@...wei.com>
Cc:     Linux Kernel Network Developers <netdev@...r.kernel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>
Subject: Re: [PATCH net-next] net: udp Allow CHECKSUM_UNNECESSARY packets to
 do GRO.

On Mon, Jan 28, 2019 at 7:00 PM maowenan <maowenan@...wei.com> wrote:
>
> Hi all,
> Do you have any comments about this change?
>
>
> On 2019/1/23 11:33, Mao Wenan wrote:
> > When udp4_gro_receive() get one packet that uh->check=0,
> > skb_gro_checksum_validate_zero_check() will set the
> > skb->ip_summed = CHECKSUM_UNNECESSARY;
> > skb->csum_level = 0;
> > Then udp_gro_receive() will flush the packet which is not CHECKSUM_PARTIAL,
> > It is not our expect,  because check=0 in udp header indicates this
> > packet is no need to caculate checksum, we should go further to do GRO.
> >
> > This patch changes the value of csum_cnt according to skb->csum_level.
> > ---
> >  include/linux/netdevice.h | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 1377d08..9c819f1 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -2764,6 +2764,7 @@ static inline void skb_gro_incr_csum_unnecessary(struct sk_buff *skb)
> >                * during GRO. This saves work if we fallback to normal path.
> >                */
> >               __skb_incr_checksum_unnecessary(skb);
> > +             NAPI_GRO_CB(skb)->csum_cnt = skb->csum_level + 1;

That doesn't look right. This would be reinitializing the GRO
checksums from the beginning.

> >       }
> >  }
> >
> >
>
I assume the code is bailing on this conditional:

if (NAPI_GRO_CB(skb)->encap_mark ||
            (skb->ip_summed != CHECKSUM_PARTIAL &&
             NAPI_GRO_CB(skb)->csum_cnt == 0 &&
             !NAPI_GRO_CB(skb)->csum_valid) ||
            !udp_sk(sk)->gro_receive)
                goto out_unlock;

I am trying to remember why this needs to check csum_cnt. If there was
a csum_cnt for the UDP csum being zero from checksum-unnecessary, it
was consumed by skb_gro_checksum_validate_zero_check in UDP4 GRO
received.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ