Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09316255 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller
Browse files

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: 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>
parent d2cb6ce7
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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) {