From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
David Ahern <dsahern@kernel.org>
Cc: Kuniyuki Iwashima <kuniyu@amazon.com>,
Kuniyuki Iwashima <kuni1840@gmail.com>, <netdev@vger.kernel.org>,
Josh Hunt <johunt@akamai.com>
Subject: [PATCH v1 net 13/15] tcp: Fix a data-race around sysctl_tcp_mtu_probe_floor.
Date: Wed, 13 Jul 2022 13:52:03 -0700 [thread overview]
Message-ID: <20220713205205.15735-14-kuniyu@amazon.com> (raw)
In-Reply-To: <20220713205205.15735-1-kuniyu@amazon.com>
While reading sysctl_tcp_mtu_probe_floor, it can be changed concurrently.
Thus, we need to add READ_ONCE() to its reader.
Fixes: c04b79b6cfd7 ("tcp: add new tcp_mtu_probe_floor sysctl")
Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
---
CC: Josh Hunt <johunt@akamai.com>
---
net/ipv4/tcp_timer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 39107bb730b0..4f3b9ab222b6 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -172,7 +172,7 @@ static void tcp_mtu_probing(struct inet_connection_sock *icsk, struct sock *sk)
} else {
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, READ_ONCE(net->ipv4.sysctl_tcp_mtu_probe_floor));
mss = max(mss, READ_ONCE(net->ipv4.sysctl_tcp_min_snd_mss));
icsk->icsk_mtup.search_low = tcp_mss_to_mtu(sk, mss);
}
--
2.30.2
next prev parent reply other threads:[~2022-07-13 20:56 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-13 20:51 [PATCH v1 net 00/15] sysctl: Fix data-races around ipv4_net_table (Round 2) Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 01/15] ip: Fix data-races around sysctl_ip_default_ttl Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 02/15] ip: Fix data-races around sysctl_ip_no_pmtu_disc Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 03/15] ip: Fix data-races around sysctl_ip_fwd_use_pmtu Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 04/15] ip: Fix data-races around sysctl_ip_fwd_update_priority Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 05/15] ip: Fix data-races around sysctl_ip_nonlocal_bind Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 06/15] ip: Fix a data-race around sysctl_ip_autobind_reuse Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 07/15] ip: Fix a data-race around sysctl_fwmark_reflect Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 08/15] tcp/dccp: Fix a data-race around sysctl_tcp_fwmark_accept Kuniyuki Iwashima
2022-07-13 20:51 ` [PATCH v1 net 09/15] tcp: Fix data-races around sysctl_tcp_l3mdev_accept Kuniyuki Iwashima
2022-07-13 20:52 ` [PATCH v1 net 10/15] tcp: Fix data-races around sysctl_tcp_mtu_probing Kuniyuki Iwashima
2022-07-13 20:52 ` [PATCH v1 net 11/15] tcp: Fix data-races around sysctl_tcp_base_mss Kuniyuki Iwashima
2022-07-13 20:52 ` [PATCH v1 net 12/15] tcp: Fix data-races around sysctl_tcp_min_snd_mss Kuniyuki Iwashima
2022-07-13 20:52 ` Kuniyuki Iwashima [this message]
2022-07-13 20:52 ` [PATCH v1 net 14/15] tcp: Fix a data-race around sysctl_tcp_probe_threshold Kuniyuki Iwashima
2022-07-13 20:52 ` [PATCH v1 net 15/15] tcp: Fix a data-race around sysctl_tcp_probe_interval Kuniyuki Iwashima
2022-07-15 11:00 ` [PATCH v1 net 00/15] sysctl: Fix data-races around ipv4_net_table (Round 2) patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220713205205.15735-14-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=johunt@akamai.com \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).