Soheil Hassas Yeganeh f626300a3e tcp: consider recv buf for the initial window scale
tcp_select_initial_window() intends to advertise a window
scaling for the maximum possible window size. To do so,
it considers the maximum of net.ipv4.tcp_rmem[2] and
net.core.rmem_max as the only possible upper-bounds.
However, users with CAP_NET_ADMIN can use SO_RCVBUFFORCE
to set the socket's receive buffer size to values
larger than net.ipv4.tcp_rmem[2] and net.core.rmem_max.
Thus, SO_RCVBUFFORCE is effectively ignored by
tcp_select_initial_window().

To fix this, consider the maximum of net.ipv4.tcp_rmem[2],
net.core.rmem_max and socket's initial buffer space.

Fixes: b0573dea1fb3 ("[NET]: Introduce SO_{SND,RCV}BUFFORCE socket options")
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Suggested-by: Neal Cardwell <ncardwell@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-07-30 21:21:57 -07:00
..
2015-08-25 13:38:50 -07:00
2016-04-27 22:48:24 -04:00
2016-06-08 11:36:02 -07:00
2016-04-27 22:48:23 -04:00
2016-03-31 08:59:56 +02:00
2016-07-09 17:45:56 -04:00
2016-06-10 23:07:49 -07:00
2016-06-10 23:07:49 -07:00
2016-06-10 23:07:49 -07:00
2014-05-23 16:28:53 -04:00
2015-09-17 17:18:37 -07:00
2013-05-31 17:19:05 -07:00