diff options
| author | Gao Feng <fgao@ikuai8.com> | 2017-03-24 07:05:12 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-03-22 09:23:22 +0100 |
| commit | 37633f021b7f88a003ef57b334c9ac31509e89f9 (patch) | |
| tree | d8dc7307e669db4528417bdcd03adadbfe895c96 /include/linux/input | |
| parent | d074ae9505e4f9f811e4df37ec7136f2900ca1ae (diff) | |
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>
Diffstat (limited to 'include/linux/input')
0 files changed, 0 insertions, 0 deletions
