From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933357Ab3E1Vch (ORCPT ); Tue, 28 May 2013 17:32:37 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:59750 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933094Ab3E1VZZ (ORCPT ); Tue, 28 May 2013 17:25:25 -0400 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Eric Dumazet , "David S. Miller" , Luis Henriques , Kamal Mostafa Subject: [PATCH 58/78] tcp: force a dst refcount when prequeue packet Date: Tue, 28 May 2013 14:20:07 -0700 Message-Id: <1369776027-17859-59-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1369776027-17859-1-git-send-email-kamal@canonical.com> References: <1369776027-17859-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.8.13.1 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Eric Dumazet commit 093162553c33e9479283e107b4431378271c735d upstream. Before escaping RCU protected section and adding packet into prequeue, make sure the dst is refcounted. Reported-by: Mike Galbraith Signed-off-by: Eric Dumazet Signed-off-by: David S. Miller [ luis: adjust context ] Signed-off-by: Luis Henriques Signed-off-by: Kamal Mostafa --- include/net/tcp.h | 1 + 1 file changed, 1 insertion(+) 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) { -- 1.8.1.2