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


Groups > linux.kernel > #1710039

[PATCH 4.12 12/17] net: avoid skb_warn_bad_offload false positives on UFO

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

Show all headers | View raw


4.12-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
@@ -2670,7 +2670,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
@@ -235,7 +235,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;
 
 	/* If there is no outer header we can fake a checksum offload
 	 * due to the fact that we have already done the checksum in
--- a/net/ipv6/udp_offload.c
+++ b/net/ipv6/udp_offload.c
@@ -72,7 +72,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;
 
 		/* If there is no outer header we can fake a checksum offload
 		 * due to the fact that we have already done the checksum in

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


Thread

[PATCH 4.12 00/17] 4.12.7-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:10 +0200
  [PATCH 4.12 12/17] net: avoid skb_warn_bad_offload false positives on UFO Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 06/17] bpf, s390: fix jit branch offset related to ldimm64 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 15/17] packet: fix tp_reserve race in packet_set_ring Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 08/17] net: sched: set xt_tgchk_param par.net properly in ipt_init_target Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 14/17] udp: consistently apply ufo or fragmentation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 09/17] net: sched: set xt_tgchk_param par.nft_compat as 0 in ipt_init_target Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 16/17] scsi: sg: only check for dxfer_len greater than 256M Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 05/17] ipv6: set rt6i_protocol properly in the route when it is installed Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 10/17] tcp: fastopen: tcp_connect() must refresh the route Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 04/17] net: fix keepalive code vs TCP_FASTOPEN_CONNECT Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 07/17] net/mlx4_en: dont set CHECKSUM_COMPLETE on SCTP packets Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 02/17] ppp: fix xmit recursion detection on ppp channels Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  [PATCH 4.12 03/17] tcp: avoid setting cwnd to invalid ssthresh after cwnd reduction states Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 00:20 +0200
  Re: [PATCH 4.12 00/17] 4.12.7-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-12 04:00 +0200
    Re: [PATCH 4.12 00/17] 4.12.7-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 16:40 +0200
  Re: [PATCH 4.12 00/17] 4.12.7-stable review Guenter Roeck <linux@roeck-us.net> - 2017-08-12 14:30 +0200
    Re: [PATCH 4.12 00/17] 4.12.7-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-12 18:10 +0200

csiph-web