netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: avoid skb_warn_bad_offload on IS_ERR
@ 2017-12-12 16:39 Willem de Bruijn
  2017-12-13 20:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Willem de Bruijn @ 2017-12-12 16:39 UTC (permalink / raw)
  To: netdev; +Cc: edumazet, davem, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

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 <willemb@google.com>
---
 net/core/dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 8aa2f70995e8..b0eee49a2489 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;
-- 
2.15.1.424.g9478a66081-goog

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: avoid skb_warn_bad_offload on IS_ERR
  2017-12-12 16:39 [PATCH net-next] net: avoid skb_warn_bad_offload on IS_ERR Willem de Bruijn
@ 2017-12-13 20:14 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-12-13 20:14 UTC (permalink / raw)
  To: willemdebruijn.kernel; +Cc: netdev, edumazet, willemb

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Tue, 12 Dec 2017 11:39:04 -0500

> From: Willem de Bruijn <willemb@google.com>
> 
> 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 <willemb@google.com>

Applied, thanks Willem.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-13 20:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 16:39 [PATCH net-next] net: avoid skb_warn_bad_offload on IS_ERR Willem de Bruijn
2017-12-13 20:14 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).