RE: UDP data corruption in v4.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Eric Dumazet <edumazet@xxxxxxxxxx>
> Sent: Monday, July 27, 2020 11:40 AM
> To: Dexuan Cui <decui@xxxxxxxxxxxxx>
> 
> On Mon, Jul 27, 2020 at 11:38 AM Dexuan Cui <decui@xxxxxxxxxxxxx> wrote:
> >
> > > From: Greg KH <greg@xxxxxxxxx>
> > > Sent: Friday, July 24, 2020 10:59 PM
> > > > [...]
> > > > Eric Dumazet made an alternative that performs the csum validation
> earlier:
> > > >
> > > > --- a/net/ipv4/udp.c
> > > > +++ b/net/ipv4/udp.c
> > > > @@ -1589,8 +1589,7 @@ int udp_queue_rcv_skb(struct sock *sk, struct
> > > > sk_buff *skb)
> > > >                 }
> > > >         }
> > > >
> > > > -       if (rcu_access_pointer(sk->sk_filter) &&
> > > > -           udp_lib_checksum_complete(skb))
> > > > +       if (udp_lib_checksum_complete(skb))
> > > >                 goto csum_error;
> > > >
> > > >         if (sk_rcvqueues_full(sk, sk->sk_rcvbuf)) {
> > > >
> > > > I personally like Eric's fix and IMHO we'd better have it in v4.4 rather than
> > > > trying to backport 327868212381.
> > >
> > > Does Eric's fix work with your testing?
> >
> > Yes, it worked in my testing overnight.
> >
> > > If so, great, can you turn it
> > > into something I can apply to the 4.4.y stable tree and send it to
> > > stable@xxxxxxxxxxxxxxx?
> > >
> > > greg k-h
> >
> > Will do shortly.
> >
> 
> Just as a reminder, please also add the IPv6 part.
> 
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index
> a8d74f44056a681ef9057c4c4abb34016120b44f..13713e0e5779b75de975faae
> b4511bef40e097dc
> 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -661,8 +661,7 @@ static int udpv6_queue_rcv_one_skb(struct sock
> *sk, struct sk_buff *skb)
>         }
> 
>         prefetch(&sk->sk_rmem_alloc);
> -       if (rcu_access_pointer(sk->sk_filter) &&
> -           udp_lib_checksum_complete(skb))
> +       if (udp_lib_checksum_complete(skb))
>                 goto csum_error;
> 
>         if (sk_filter_trim_cap(sk, skb, sizeof(struct udphdr)))

Oh, yes! :-) Thank you!

Eric, I'll add your Signed-off-by and mine. Please let me know in case
this is not ok.

I'll do a little more testing with the patch and I plan to post the patch
to stable@xxxxxxxxxxxxxxx and netdev@xxxxxxxxxxxxxxx this afternoon,
i.e. in 3~4 hours or so. 

Thanks,
-- Dexuan




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux