From: Eric Dumazet Date: Thu, 25 Apr 2013 01:34:55 +0000 (-0700) Subject: tcp: force a dst refcount when prequeue packet X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=093162553c33;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git tcp: force a dst refcount when prequeue packet 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 --- diff --git a/include/net/tcp.h b/include/net/tcp.h index cf0694d4ad60..a34548041c17 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1049,6 +1049,7 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb) skb_queue_len(&tp->ucopy.prequeue) == 0) 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) {