diff options
author | Eric Dumazet <edumazet@google.com> | 2023-03-15 20:57:44 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-03-17 08:25:05 +0000 |
commit | e13ec3da05d130f0d10da8e1fbe1be26dcdb0e27 (patch) | |
tree | 87c774f8a05afcf7ae1993b2fb1b2416bbabc922 /net/ipv4/tcp_output.c | |
parent | 2f2d9972affae1f3282eff97c794cf843aedf61e (diff) |
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 <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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 71d01cf3c13e..f7e00d90a730 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -3699,7 +3699,7 @@ static void tcp_connect_init(struct sock *sk) tp->rx_opt.rcv_wscale = rcv_wscale; tp->rcv_ssthresh = tp->rcv_wnd; - sk->sk_err = 0; + WRITE_ONCE(sk->sk_err, 0); sock_reset_flag(sk, SOCK_DONE); tp->snd_wnd = 0; tcp_init_wl(tp, 0); |