From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Willem de Bruijn <willemb@google.com>,
"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 4.12 12/17] net: avoid skb_warn_bad_offload false positives on UFO
Date: Fri, 11 Aug 2017 15:01:31 -0700 [thread overview]
Message-ID: <20170811220036.146216482@linuxfoundation.org> (raw)
In-Reply-To: <20170811220035.638197338@linuxfoundation.org>
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
next prev parent reply other threads:[~2017-08-11 22:01 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-11 22:01 [PATCH 4.12 00/17] 4.12.7-stable review Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 01/17] ppp: Fix false xmit recursion detect with two ppp devices Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 02/17] ppp: fix xmit recursion detection on ppp channels Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 03/17] tcp: avoid setting cwnd to invalid ssthresh after cwnd reduction states Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 04/17] net: fix keepalive code vs TCP_FASTOPEN_CONNECT Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 05/17] ipv6: set rt6i_protocol properly in the route when it is installed Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 06/17] bpf, s390: fix jit branch offset related to ldimm64 Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 07/17] net/mlx4_en: dont set CHECKSUM_COMPLETE on SCTP packets Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 08/17] net: sched: set xt_tgchk_param par.net properly in ipt_init_target Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 09/17] net: sched: set xt_tgchk_param par.nft_compat as 0 " Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 10/17] tcp: fastopen: tcp_connect() must refresh the route Greg Kroah-Hartman
2017-08-11 22:01 ` Greg Kroah-Hartman [this message]
2017-08-11 22:01 ` [PATCH 4.12 13/17] igmp: Fix regression caused by igmp sysctl namespace code Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 14/17] udp: consistently apply ufo or fragmentation Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 15/17] packet: fix tp_reserve race in packet_set_ring Greg Kroah-Hartman
2017-08-11 22:01 ` [PATCH 4.12 16/17] scsi: sg: only check for dxfer_len greater than 256M Greg Kroah-Hartman
2017-08-12 1:55 ` [PATCH 4.12 00/17] 4.12.7-stable review Shuah Khan
2017-08-12 14:30 ` Greg Kroah-Hartman
2017-08-12 12:24 ` Guenter Roeck
2017-08-12 16:07 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170811220036.146216482@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).