diff options
| author | Eric Dumazet <[email protected]> | 2023-03-15 20:57:44 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-03-17 08:25:05 +0000 |
| commit | e13ec3da05d130f0d10da8e1fbe1be26dcdb0e27 (patch) | |
| tree | 87c774f8a05afcf7ae1993b2fb1b2416bbabc922 /net/ipv4/tcp_timer.c | |
| parent | net: annotate lockless accesses to sk->sk_err_soft (diff) | |
| download | kernel-e13ec3da05d130f0d10da8e1fbe1be26dcdb0e27.tar.gz kernel-e13ec3da05d130f0d10da8e1fbe1be26dcdb0e27.zip | |
tcp: annotate lockless access to sk->sk_err
tcp_poll() reads sk->sk_err without socket lock held/owned.
We should used READ_ONCE() here, and update writers
to use WRITE_ONCE().
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
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 8823e2182713..b839c2f91292 100644 --- a/net/ipv4/tcp_timer.c +++ b/net/ipv4/tcp_timer.c @@ -67,7 +67,7 @@ u32 tcp_clamp_probe0_to_user_timeout(const struct sock *sk, u32 when) static void tcp_write_err(struct sock *sk) { - sk->sk_err = READ_ONCE(sk->sk_err_soft) ? : ETIMEDOUT; + WRITE_ONCE(sk->sk_err, READ_ONCE(sk->sk_err_soft) ? : ETIMEDOUT); sk_error_report(sk); tcp_write_queue_purge(sk); |
