Files
linux/include/net
Gao Feng 37633f021b tcp: sysctl: Fix a race to avoid unexpected 0 window from space
[ Upstream commit c48367427a39ea0b85c7cf018fe4256627abfd9e ]

Because sysctl_tcp_adv_win_scale could be changed any time, so there
is one race in tcp_win_from_space.
For example,
1.sysctl_tcp_adv_win_scale<=0 (sysctl_tcp_adv_win_scale is negative now)
2.space>>(-sysctl_tcp_adv_win_scale) (sysctl_tcp_adv_win_scale is postive now)

As a result, tcp_win_from_space returns 0. It is unexpected.

Certainly if the compiler put the sysctl_tcp_adv_win_scale into one
register firstly, then use the register directly, it would be ok.
But we could not depend on the compiler behavior.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-22 09:23:22 +01:00
..
2015-06-28 16:55:44 -07:00
2016-04-20 15:42:04 +09:00
2015-03-06 21:50:02 -05:00
2015-09-17 17:18:37 -07:00
2018-02-25 11:03:34 +01:00
2017-06-07 12:05:59 +02:00
2014-09-30 01:02:26 -04:00
2015-10-08 04:27:03 -07:00
2015-10-23 06:26:42 -07:00
2018-02-25 11:03:40 +01:00
2016-11-15 07:46:36 +01:00
2015-03-12 22:58:12 -04:00
2015-10-26 22:24:22 -07:00