Commit 36fced6b authored by Eric Dumazet's avatar Eric Dumazet Committed by Ben Hutchings

tcp: force a dst refcount when prequeue packet

[ Upstream commit 09316255 ]

Before escaping RCU protected section and adding packet into
prequeue, make sure the dst is refcounted.
Reported-by: default avatarMike Galbraith <bitbucket@online.de>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent 2a068400
...@@ -931,6 +931,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb) ...@@ -931,6 +931,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
if (sysctl_tcp_low_latency || !tp->ucopy.task) if (sysctl_tcp_low_latency || !tp->ucopy.task)
return 0; return 0;
skb_dst_force(skb);
__skb_queue_tail(&tp->ucopy.prequeue, skb); __skb_queue_tail(&tp->ucopy.prequeue, skb);
tp->ucopy.memory += skb->truesize; tp->ucopy.memory += skb->truesize;
if (tp->ucopy.memory > sk->sk_rcvbuf) { if (tp->ucopy.memory > sk->sk_rcvbuf) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment