From: Willem de Bruijn Date: Tue, 12 Dec 2017 16:39:04 +0000 (-0500) Subject: net: avoid skb_warn_bad_offload on IS_ERR X-Git-Tag: v5.15~9522^2~368 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d74e9f88d65af8bb2e095aff506aa6eac755ada;p=platform%2Fkernel%2Flinux-starfive.git net: avoid skb_warn_bad_offload on IS_ERR skb_warn_bad_offload warns when packets enter the GSO stack that require skb_checksum_help or vice versa. Do not warn on arbitrary bad packets. Packet sockets can craft many. Syzkaller was able to demonstrate another one with eth_type games. In particular, suppress the warning when segmentation returns an error, which is for reasons other than checksum offload. See also commit 36c92474498a ("net: WARN if skb_checksum_help() is called on skb requiring segmentation") for context on this warning. Signed-off-by: Willem de Bruijn Signed-off-by: David S. Miller --- diff --git a/net/core/dev.c b/net/core/dev.c index 8aa2f70..b0eee49 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2803,7 +2803,7 @@ struct sk_buff *__skb_gso_segment(struct sk_buff *skb, segs = skb_mac_gso_segment(skb, features); - if (unlikely(skb_needs_check(skb, tx_path))) + if (unlikely(skb_needs_check(skb, tx_path) && !IS_ERR(segs))) skb_warn_bad_offload(skb); return segs;