mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 07:13:34 +00:00
net: datagram: fix unbounded loop in __skb_try_recv_datagram()
[ Upstream commit0b91bce1eb
] Christoph reported a stall while peeking datagram with an offset when busy polling is enabled. __skb_try_recv_datagram() uses as the loop termination condition 'queue empty'. When peeking, the socket queue can be not empty, even when no additional packets are received. Address the issue explicitly checking for receive queue changes, as currently done by __skb_wait_for_more_packets(). Fixes:2b5cd0dfa3
("net: Change return type of sk_busy_loop from bool to void") Reported-and-tested-by: Christoph Paasch <cpaasch@apple.com> Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7ca0727ee4
commit
701052e17b
1 changed files with 1 additions and 1 deletions
|
@ -281,7 +281,7 @@ struct sk_buff *__skb_try_recv_datagram(struct sock *sk, unsigned int flags,
|
|||
break;
|
||||
|
||||
sk_busy_loop(sk, flags & MSG_DONTWAIT);
|
||||
} while (!skb_queue_empty(&sk->sk_receive_queue));
|
||||
} while (sk->sk_receive_queue.prev != *last);
|
||||
|
||||
error = -EAGAIN;
|
||||
|
||||
|
|
Loading…
Reference in a new issue