summaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorKuniyuki Iwashima <kuniyu@amazon.com>2022-07-20 09:50:20 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-08-03 12:03:46 +0200
commita88de75673e4f898564f90feb61e5d625e03c4c4 (patch)
treecd51330195f933300c58110c02e2c7fd50f4d07d /net/ipv4
parent664a3311e6716c2361cf64a38a00a0ef8cb78b38 (diff)
downloadlinux-stable-a88de75673e4f898564f90feb61e5d625e03c4c4.tar.gz
linux-stable-a88de75673e4f898564f90feb61e5d625e03c4c4.tar.bz2
linux-stable-a88de75673e4f898564f90feb61e5d625e03c4c4.zip
tcp: Fix a data-race around sysctl_tcp_limit_output_bytes.
commit 9fb90193fbd66b4c5409ef729fd081861f8b6351 upstream. While reading sysctl_tcp_limit_output_bytes, it can be changed concurrently. Thus, we need to add READ_ONCE() to its reader. Fixes: 46d3ceabd8d9 ("tcp: TCP Small Queues") Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/tcp_output.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 43ecbd796635..4389ad7e4c8c 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -2503,7 +2503,7 @@ static bool tcp_small_queue_check(struct sock *sk, const struct sk_buff *skb,
sk->sk_pacing_rate >> READ_ONCE(sk->sk_pacing_shift));
if (sk->sk_pacing_status == SK_PACING_NONE)
limit = min_t(unsigned long, limit,
- sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes);
+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_limit_output_bytes));
limit <<= factor;
if (static_branch_unlikely(&tcp_tx_delay_enabled) &&