Files
Gao Feng 694f219a60 tcp: sysctl: Fix a race to avoid unexpected 0 window from space
[ Upstream commit c48367427a ]

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:17:43 +01:00
..
2016-09-27 21:15:21 -04:00
2016-09-23 08:38:50 -04:00
2017-06-07 12:07:46 +02:00
2016-10-14 10:59:15 -04:00
2016-10-03 02:00:22 -04:00
2016-10-04 02:11:51 -04:00
2018-02-25 11:05:48 +01:00
2017-12-16 16:25:45 +01:00
2017-07-21 07:42:18 +02:00