Patchwork [3.8.y.z,extended,stable] Patch "tcp: force a dst refcount when prequeue packet" has been added to staging queue

login
register
mail settings
Submitter Kamal Mostafa
Date May 24, 2013, 5:37 p.m.
Message ID <1369417078-8594-1-git-send-email-kamal@canonical.com>
Download mbox | patch
Permalink /patch/246250/
State New
Headers show

Comments

Kamal Mostafa - May 24, 2013, 5:37 p.m.
This is a note to let you know that I have just added a patch titled

    tcp: force a dst refcount when prequeue packet

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Kamal

------

From 6b63d5201129bb0399ff1370b7385661bd334f11 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <edumazet@google.com>
Date: Wed, 24 Apr 2013 18:34:55 -0700
Subject: tcp: force a dst refcount when prequeue packet

commit 093162553c33e9479283e107b4431378271c735d upstream.

Before escaping RCU protected section and adding packet into
prequeue, make sure the dst is refcounted.

Reported-by: Mike Galbraith <bitbucket@online.de>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[ luis: adjust context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 include/net/tcp.h | 1 +
 1 file changed, 1 insertion(+)

--
1.8.1.2

Patch

diff --git a/include/net/tcp.h b/include/net/tcp.h
index aed42c7..4da2167 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -1045,6 +1045,7 @@  static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)
 	if (sysctl_tcp_low_latency || !tp->ucopy.task)
 		return false;

+	skb_dst_force(skb);
 	__skb_queue_tail(&tp->ucopy.prequeue, skb);
 	tp->ucopy.memory += skb->truesize;
 	if (tp->ucopy.memory > sk->sk_rcvbuf) {