diff options
author | Kuniyuki Iwashima <kuniyu@amazon.com> | 2022-07-13 13:52:00 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-07-15 11:49:55 +0100 |
commit | f47d00e077e7d61baf69e46dde3210c886360207 (patch) | |
tree | bfd718a178b32898319aa4f2f771f5651cebb74c /net/ipv4/tcp_timer.c | |
parent | 08a75f10679470552a3a443f9aefd1399604d31d (diff) | |
download | lwn-f47d00e077e7d61baf69e46dde3210c886360207.tar.gz lwn-f47d00e077e7d61baf69e46dde3210c886360207.zip |
tcp: Fix data-races around sysctl_tcp_mtu_probing.
While reading sysctl_tcp_mtu_probing, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its readers.
Fixes: 5d424d5a674f ("[TCP]: MTU probing")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_timer.c')
-rw-r--r-- | net/ipv4/tcp_timer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c index 20cf4a98c69d..98bb00e29e1e 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -163,7 +163,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk) int mss; /* Black hole detection */ - if (!net->ipv4.sysctl_tcp_mtu_probing) + if (!READ_ONCE(net->ipv4.sysctl_tcp_mtu_probing)) return; if (!icsk->icsk_mtup.enabled) { |