Skip to content

Commit 756cecd

Browse files
edumazetgregkh
authored andcommitted
tcp: force a dst refcount when prequeue packet
[ Upstream commit 0931625 ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f28cecc commit 756cecd

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎include/net/tcp.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,7 @@ static inline bool tcp_prequeue(struct sock *sk, struct sk_buff *skb)
10491049
skb_queue_len(&tp->ucopy.prequeue) == 0)
10501050
return false;
10511051

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

0 commit comments

Comments
 (0)