Eric Dumazet 4e43b6a8b4 tcp: do not overshoot window_clamp in tcp_rcv_space_adjust()
commit 02db55718d53f9d426cee504c27fb768e9ed4ffe upstream.

While rcvbuf is properly clamped by tcp_rmem[2], rcvwin
is left to a potentially too big value.

It has no serious effect, since :
1) tcp_grow_window() has very strict checks.
2) window_clamp can be mangled by user space to any value anyway.

tcp_init_buffer_space() and companions use tcp_full_space(),
we use tcp_win_from_space() to avoid reloading sk->sk_rcvbuf

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Acked-by: Wei Wang <weiwan@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Benjamin Gilbert <benjamin.gilbert@coreos.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-26 08:08:06 +08:00
..
2018-05-16 10:08:44 +02:00
2016-12-03 23:54:25 -05:00
2017-11-15 15:53:17 +01:00
2018-04-13 19:48:29 +02:00
2016-05-29 22:33:25 -07:00
2016-10-20 11:23:08 -04:00
2018-05-30 07:50:28 +02:00
2018-06-13 16:16:42 +02:00
2018-05-30 07:50:32 +02:00
2018-05-30 07:50:25 +02:00
2018-04-24 09:34:17 +02:00
2016-08-17 19:36:23 -04:00
2016-08-17 19:36:23 -04:00