summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2020-06-30 13:51:28 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-22 09:32:48 +0200
commit7eec9f33122339883a99fa403e9444bad2065db5 (patch)
tree19b2df16fac78649ed705569b4fb06b7e3af089b /net
parent9b7fd81cf9b6ca322cffc6aff4be0f2d54e9689a (diff)
downloadlinux-stable-7eec9f33122339883a99fa403e9444bad2065db5.tar.gz
linux-stable-7eec9f33122339883a99fa403e9444bad2065db5.tar.bz2
linux-stable-7eec9f33122339883a99fa403e9444bad2065db5.zip
tcp: fix SO_RCVLOWAT possible hangs under high mem pressure
[ Upstream commit ba3bb0e76ccd464bb66665a1941fabe55dadb3ba ] Whenever tcp_try_rmem_schedule() returns an error, we are under trouble and should make sure to wakeup readers so that they can drain socket queues and eventually make room. Fixes: 03f45c883c6f ("tcp: avoid extra wakeups for SO_RCVLOWAT users") 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>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_input.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3e63dc9c3eba..6d331307beca 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4564,6 +4564,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
+ sk->sk_data_ready(sk);
tcp_drop(sk, skb);
return;
}
@@ -4807,6 +4808,7 @@ queue_and_out:
sk_forced_mem_schedule(sk, skb->truesize);
else if (tcp_try_rmem_schedule(sk, skb, skb->truesize)) {
NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPRCVQDROP);
+ sk->sk_data_ready(sk);
goto drop;
}