Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-31 Thread David Miller
From: Cong Wang Date: Mon, 29 Oct 2018 17:35:15 -0700 > Most callers of pskb_trim_rcsum() simply drops the skb when > it fails, however, ip_check_defrag() still continues to pass > the skb up to stack. In that case, we should restore its previous > csum if __pskb_trim() fails. > > Found this

Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-30 Thread Cong Wang
On Mon, Oct 29, 2018 at 8:08 PM Eric Dumazet wrote: > > > > On 10/29/2018 07:41 PM, Cong Wang wrote: > > On Mon, Oct 29, 2018 at 7:25 PM Eric Dumazet wrote: > >> > >> > >> > >> On 10/29/2018 07:21 PM, Cong Wang wrote: > >>> On Mon, Oct 29, 2018 at 7:14 PM Eric Dumazet > >>> wrote: > >

Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-29 Thread Eric Dumazet
On 10/29/2018 07:41 PM, Cong Wang wrote: > On Mon, Oct 29, 2018 at 7:25 PM Eric Dumazet wrote: >> >> >> >> On 10/29/2018 07:21 PM, Cong Wang wrote: >>> On Mon, Oct 29, 2018 at 7:14 PM Eric Dumazet wrote: Would not it be simpler to set ip_summed to CHECKSUM_NONE (no need to save

Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-29 Thread Cong Wang
On Mon, Oct 29, 2018 at 7:25 PM Eric Dumazet wrote: > > > > On 10/29/2018 07:21 PM, Cong Wang wrote: > > On Mon, Oct 29, 2018 at 7:14 PM Eric Dumazet wrote: > >> > >> Would not it be simpler to set ip_summed to CHECKSUM_NONE (no need to save > >> old_csum) ? > > > > For !CHECKSUM_COMPLETE,

Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-29 Thread Eric Dumazet
On 10/29/2018 07:21 PM, Cong Wang wrote: > On Mon, Oct 29, 2018 at 7:14 PM Eric Dumazet wrote: >> >> Would not it be simpler to set ip_summed to CHECKSUM_NONE (no need to save >> old_csum) ? > > For !CHECKSUM_COMPLETE, ip_summed should be untouched, right? > > If you mean only setting to

Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-29 Thread Cong Wang
On Mon, Oct 29, 2018 at 7:14 PM Eric Dumazet wrote: > > Would not it be simpler to set ip_summed to CHECKSUM_NONE (no need to save > old_csum) ? For !CHECKSUM_COMPLETE, ip_summed should be untouched, right? If you mean only setting to CHECKSUM_NONE for CHECKSUM_COMPLETE case, the end result

Re: [Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-29 Thread Eric Dumazet
On 10/29/2018 05:35 PM, Cong Wang wrote: > Most callers of pskb_trim_rcsum() simply drops the skb when > it fails, however, ip_check_defrag() still continues to pass > the skb up to stack. In that case, we should restore its previous > csum if __pskb_trim() fails. > > Found this during code

[Patch net] net: make pskb_trim_rcsum_slow() robust

2018-10-29 Thread Cong Wang
Most callers of pskb_trim_rcsum() simply drops the skb when it fails, however, ip_check_defrag() still continues to pass the skb up to stack. In that case, we should restore its previous csum if __pskb_trim() fails. Found this during code review. Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and