tcp: Fix data-races around sysctl_tcp_min_snd_mss.
[ Upstream commit 78eb166cdefcc3221c8c7c1e2d514e91a2eb5014 ]
While reading sysctl_tcp_min_snd_mss, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.
Fixes: 5f3e2bf008
("tcp: add tcp_min_snd_mss sysctl")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
514d2254c7
commit
97992e8fef
@@ -173,7 +173,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk)
|
||||
mss = tcp_mtu_to_mss(sk, icsk->icsk_mtup.search_low) >> 1;
|
||||
mss = min(READ_ONCE(net->ipv4.sysctl_tcp_base_mss), mss);
|
||||
mss = max(mss, net->ipv4.sysctl_tcp_mtu_probe_floor);
|
||||
mss = max(mss, net->ipv4.sysctl_tcp_min_snd_mss);
|
||||
mss = max(mss, READ_ONCE(net->ipv4.sysctl_tcp_min_snd_mss));
|
||||
icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, mss);
|
||||
}
|
||||
tcp_sync_mss(sk, icsk->icsk_pmtu_cookie);
|
||||
|
Reference in New Issue
Block a user