Re: [Patch net] net: make pskb_trim_rcsum_slow() robust
From: David Miller <davem@davemloft.net>
Date: 2018-11-01 04:35:43
From: David Miller <davem@davemloft.net>
Date: 2018-11-01 04:35:43
From: Cong Wang <redacted> 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 during code review.
Fixes: 88078d98d1bb ("net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends")
Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <redacted>I kind of agree with Eric that we should make all callers, including ip_check_defrag(), fail just as with any memory allocation failure.