[SRU][LTS-Utopic] Revert "net: Fix skb csum races when peeking"

Luis Henriques luis.henriques at canonical.com
Fri Oct 23 11:08:05 UTC 2015


BugLink: https://bugs.launchpad.net/bugs/1508510

This reverts commit 7e093d249d1679ba88868299904450274d7653c0, which
was commit 89c22d8c3b278212eef6a8cc66b570bc840a6f5a upstream.

A fix is being discussed upstream as stable kernels < 3.19 are impacted.

Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 net/core/datagram.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/net/core/datagram.c b/net/core/datagram.c
index 3c69a464595e..01a721aa245c 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -780,8 +780,7 @@ __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len)
 		    !skb->csum_complete_sw)
 			netdev_rx_csum_fault(skb->dev);
 	}
-	if (!skb_shared(skb))
-		skb->csum_valid = !sum;
+	skb->csum_valid = !sum;
 	return sum;
 }
 EXPORT_SYMBOL(__skb_checksum_complete_head);
@@ -801,13 +800,11 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb)
 			netdev_rx_csum_fault(skb->dev);
 	}
 
-	if (!skb_shared(skb)) {
-		/* Save full packet checksum */
-		skb->csum = csum;
-		skb->ip_summed = CHECKSUM_COMPLETE;
-		skb->csum_complete_sw = 1;
-		skb->csum_valid = !sum;
-	}
+	/* Save full packet checksum */
+	skb->csum = csum;
+	skb->ip_summed = CHECKSUM_COMPLETE;
+	skb->csum_complete_sw = 1;
+	skb->csum_valid = !sum;
 
 	return sum;
 }




More information about the kernel-team mailing list