Patch "net: avoid skb_warn_bad_offload false positives on UFO" has been added to the 4.9-stable tree
Subsystems (2)
This is a note to let you know that I've just added the patch titled
net: avoid skb_warn_bad_offload false positives on UFO
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-avoid-skb_warn_bad_offload-false-positives-on-ufo.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From foo@baz Fri Aug 11 09:10:20 PDT 2017
From: Willem de Bruijn <[email protected]>
Date: Tue, 8 Aug 2017 14:22:55 -0400
Subject: net: avoid skb_warn_bad_offload false positives on UFO
From: Willem de Bruijn <[email protected]>
[ 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/
--- net/core/dev.c | 2 +- net/ipv4/udp_offload.c | 2 +- net/ipv6/udp_offload.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
net/core/dev.c +1 -1
@@ -2703,7 +2703,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 ; }
net/ipv4/udp_offload.c +1 -1
@@ -232,7 +232,7 @@ static struct sk_buff *udp4_ufo_fragmentif (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
net/ipv6/udp_offload.c +1 -1
@@ -72,7 +72,7 @@ static struct sk_buff *udp6_ufo_fragmentif (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
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/net-avoid-skb_warn_bad_offload-false-positives-on-ufo.patch queue-4.9/packet-fix-tp_reserve-race-in-packet_set_ring.patch queue-4.9/udp-consistently-apply-ufo-or-fragmentation.patch