]> git.baikalelectronics.ru Git - kernel.git/commit
net: datagram: fix unbounded loop in __skb_try_recv_datagram()
authorPaolo Abeni <pabeni@redhat.com>
Mon, 25 Mar 2019 13:18:06 +0000 (14:18 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Mar 2019 04:58:53 +0000 (21:58 -0700)
commit6340b1bd0b12345d649b1ab6f005b31f3791aa53
treefe2f7e46069304d0abf7d2d2aa9b3d56e45ae09e
parent93cb04bf074f5dc6171dbd50262a7950a0b6007c
net: datagram: fix unbounded loop in __skb_try_recv_datagram()

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: 91bdbc59a6df ("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>
net/core/datagram.c