| From c58d04e22ee74888bbc824e44a6429f8161ccf0c Mon Sep 17 00:00:00 2001 |
| From: Eric Dumazet <edumazet@google.com> |
| Date: Wed, 24 Apr 2013 18:34:55 -0700 |
| Subject: [PATCH] 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 <bitbucket@online.de> |
| Signed-off-by: Eric Dumazet <edumazet@google.com> |
| Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
| --- |
| include/net/tcp.h | 1 + |
| 1 file changed, 1 insertion(+) |
| |
| --- a/include/net/tcp.h |
| +++ b/include/net/tcp.h |
| @@ -1045,6 +1045,7 @@ static inline bool tcp_prequeue(struct s |
| 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) { |