diff options
author | Eric Dumazet <edumazet@google.com> | 2023-08-19 07:06:46 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-08-21 09:41:57 +0300 |
commit | bc1fb82ae11753c5dec53c667a055dc37796dbd2 (patch) | |
tree | bc3c0b2eb87f188a8542759a0970754c6f4ad8e8 /net/sched/em_meta.c | |
parent | b4672c733713f3bc9029c83efa7a2f1ef42ddf5b (diff) | |
download | linux-bc1fb82ae11753c5dec53c667a055dc37796dbd2.tar.xz |
net: annotate data-races around sk->sk_lingertime
sk_getsockopt() runs locklessly. This means sk->sk_lingertime
can be read while other threads are changing its value.
Other reads also happen without socket lock being held,
and must be annotated.
Remove preprocessor logic using BITS_PER_LONG, compilers
are smart enough to figure this by themselves.
v2: fixed a clang W=1 (-Wtautological-constant-out-of-range-compare) warning
(Jakub)
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/em_meta.c')
-rw-r--r-- | net/sched/em_meta.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sched/em_meta.c b/net/sched/em_meta.c index 6fdba069f6bf..da34fd4c9269 100644 --- a/net/sched/em_meta.c +++ b/net/sched/em_meta.c @@ -502,7 +502,7 @@ META_COLLECTOR(int_sk_lingertime) *err = -1; return; } - dst->value = sk->sk_lingertime / HZ; + dst->value = READ_ONCE(sk->sk_lingertime) / HZ; } META_COLLECTOR(int_sk_err_qlen) |