Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1710030

[PATCH 3.18 5/9] net: avoid skb_warn_bad_offload false positives on UFO

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 3.18 5/9] net: avoid skb_warn_bad_offload false positives on UFO
Date 2017-08-12 00:10 +0200
Message-ID <udqhZ-E7-73@gated-at.bofh.it> (permalink)
References <udqhX-E7-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


3.18-stable review patch.  If anyone has any objections, please let me know.

------------------

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


[ Upstream commit 8d63bee643f1fb53e472f0e135cae4eb99d62d19 ]

skb_warn_bad_offload triggers a warning when an skb enters the GSO
stack at __skb_gso_segment that does not have CHECKSUM_PARTIAL
checksum offload set.

Commit b2504a5dbef3 ("net: reduce skb_warn_bad_offload() noise")
observed that SKB_GSO_DODGY producers can trigger the check and
that passing those packets through the GSO handlers will fix it
up. But, the software UFO handler will set ip_summed to
CHECKSUM_NONE.

When __skb_gso_segment is called from the receive path, this
triggers the warning again.

Make UFO set CHECKSUM_UNNECESSARY instead of CHECKSUM_NONE. On
Tx these two are equivalent. On Rx, this better matches the
skb state (checksum computed), as CHECKSUM_NONE here means no
checksum computed.

See also this thread for context:
http://patchwork.ozlabs.org/patch/799015/

Fixes: b2504a5dbef3 ("net: reduce skb_warn_bad_offload() noise")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 net/core/dev.c         |    2 +-
 net/ipv4/udp_offload.c |    2 +-
 net/ipv6/udp_offload.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2436,7 +2436,7 @@ static inline bool skb_needs_check(struc
 {
 	if (tx_path)
 		return skb->ip_summed != CHECKSUM_PARTIAL &&
-		       skb->ip_summed != CHECKSUM_NONE;
+		       skb->ip_summed != CHECKSUM_UNNECESSARY;
 
 	return skb->ip_summed == CHECKSUM_NONE;
 }
--- a/net/ipv4/udp_offload.c
+++ b/net/ipv4/udp_offload.c
@@ -198,7 +198,7 @@ static struct sk_buff *udp4_ufo_fragment
 	if (uh->check == 0)
 		uh->check = CSUM_MANGLED_0;
 
-	skb->ip_summed = CHECKSUM_NONE;
+	skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 	/* Fragment the skb. IP headers of the fragments are updated in
 	 * inet_gso_segment()
--- a/net/ipv6/udp_offload.c
+++ b/net/ipv6/udp_offload.c
@@ -82,7 +82,7 @@ static struct sk_buff *udp6_ufo_fragment
 		if (uh->check == 0)
 			uh->check = CSUM_MANGLED_0;
 
-		skb->ip_summed = CHECKSUM_NONE;
+		skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* Check if there is enough headroom to insert fragment header. */
 		tnl_hlen = skb_tnl_header_len(skb);

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 3.18 0/9] 3.18.65-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:10 +0200
  [PATCH 3.18 2/9] net: fix keepalive code vs TCP_FASTOPEN_CONNECT Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:10 +0200
  [PATCH 3.18 1/9] tcp: avoid setting cwnd to invalid ssthresh after cwnd reduction states Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:10 +0200
  [PATCH 3.18 5/9] net: avoid skb_warn_bad_offload false positives on UFO Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:10 +0200
  Re: [PATCH 3.18 0/9] 3.18.65-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-12 04:00 +0200
  Re: [PATCH 3.18 0/9] 3.18.65-stable review Guenter Roeck <linux@roeck-us.net> - 2017-08-12 14:30 +0200

csiph-web