diff options
| author | Eric Dumazet <[email protected]> | 2019-11-05 22:11:54 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2019-11-07 00:14:48 +0000 |
| commit | 099ecf59f05b5f30f42ebac0ab8cb94f9b18c90c (patch) | |
| tree | 06d62b7b24635bbb78ad38f24933cad260b5c346 /net/ipv4/tcp_diag.c | |
| parent | net: annotate lockless accesses to sk->sk_ack_backlog (diff) | |
| download | kernel-099ecf59f05b5f30f42ebac0ab8cb94f9b18c90c.tar.gz kernel-099ecf59f05b5f30f42ebac0ab8cb94f9b18c90c.zip | |
net: annotate lockless accesses to sk->sk_max_ack_backlog
sk->sk_max_ack_backlog can be read without any lock being held
at least in TCP/DCCP cases.
We need to use READ_ONCE()/WRITE_ONCE() to avoid load/store tearing
and/or potential KCSAN warnings.
Signed-off-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_diag.c')
| -rw-r--r-- | net/ipv4/tcp_diag.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c index edfbab54c46f..0d08f9e2d8d0 100644 --- a/net/ipv4/tcp_diag.c +++ b/net/ipv4/tcp_diag.c @@ -22,7 +22,7 @@ static void tcp_diag_get_info(struct sock *sk, struct inet_diag_msg *r, if (inet_sk_state_load(sk) == TCP_LISTEN) { r->idiag_rqueue = READ_ONCE(sk->sk_ack_backlog); - r->idiag_wqueue = sk->sk_max_ack_backlog; + r->idiag_wqueue = READ_ONCE(sk->sk_max_ack_backlog); } else if (sk->sk_type == SOCK_STREAM) { const struct tcp_sock *tp = tcp_sk(sk); |
