Soheil Hassas Yeganeh 867f816bad tcp: limit sk_rcvlowat by the maximum receive buffer
The user-provided value to setsockopt(SO_RCVLOWAT) can be
larger than the maximum possible receive buffer. Such values
mute POLLIN signals on the socket which can stall progress
on the socket.

Limit the user-provided value to half of the maximum receive
buffer, i.e., half of sk_rcvbuf when the receive buffer size
is set by the user, or otherwise half of sysctl_tcp_rmem[2].

Fixes: d1361840f8c5 ("tcp: fix SO_RCVLOWAT and RCVBUF autotuning")
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-06-10 14:12:50 -07:00
..
2018-06-03 00:02:05 +02:00
2018-05-16 07:24:30 +02:00
2017-10-21 01:33:19 +01:00
2018-04-23 10:21:24 -04:00
2018-03-27 13:18:09 -04:00
2018-03-27 13:18:09 -04:00
2018-05-16 07:24:30 +02:00
2018-03-27 13:18:09 -04:00
2018-03-27 13:18:09 -04:00
2018-05-16 07:24:30 +02:00
2018-05-16 07:24:30 +02:00
2017-10-16 21:24:25 +01:00
2018-05-18 11:40:27 -04:00
2018-02-28 11:43:28 -05:00