Skip to contentSkip to conversation

net: avoid skb_warn_bad_offload on IS_ERR

PATCH Applied Willem de Bruijn 2 participants 2 messages Dec 12, 2017 – Dec 13, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: avoid skb_warn_bad_offload on IS_ERR

From: Willem de Bruijn <[email protected]>

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.

---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/dev.c +1 -1
index 8aa2f70995e8..b0eee49a2489 100644
@@ -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;
Signature · 1 line
2.15.1.424.g9478a66081-goog
maintainer Applied
#1 lore raw

From: Willem de Bruijn <[email protected]>
Date: Tue, 12 Dec 2017 11:39:04 -0500

Quoted 7 lines

From: Willem de Bruijn <[email protected]>

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.

Quoted 7 lines

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.

Applied, thanks Willem.