diff options
| author | Kuniyuki Iwashima <[email protected]> | 2022-07-15 17:17:50 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-07-18 11:21:54 +0000 |
| commit | 39e24435a776e9de5c6dd188836cf2523547804b (patch) | |
| tree | ce395ff289b73323451466c54d20b0c8bf4668f0 /net/ipv4/tcp_output.c | |
| parent | tcp: Fix data-races around sysctl_tcp_reordering. (diff) | |
| download | kernel-39e24435a776e9de5c6dd188836cf2523547804b.tar.gz kernel-39e24435a776e9de5c6dd188836cf2523547804b.zip | |
tcp: Fix data-races around some timeout sysctl knobs.
While reading these sysctl knobs, they can be changed concurrently.
Thus, we need to add READ_ONCE() to their readers.
- tcp_retries1
- tcp_retries2
- tcp_orphan_retries
- tcp_fin_timeout
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Kuniyuki Iwashima <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 02ab3a9c6657..3b3552d292a5 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -4090,7 +4090,7 @@ void tcp_send_probe0(struct sock *sk) icsk->icsk_probes_out++; if (err <= 0) { - if (icsk->icsk_backoff < net->ipv4.sysctl_tcp_retries2) + if (icsk->icsk_backoff < READ_ONCE(net->ipv4.sysctl_tcp_retries2)) icsk->icsk_backoff++; timeout = tcp_probe0_when(sk, TCP_RTO_MAX); } else { |
