net: annotate data-races around sk->sk_lingertime
authorEric Dumazet <edumazet@google.com>
Sat, 19 Aug 2023 04:06:46 +0000 (04:06 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:33 +0000 (09:42 +0200)
commit9257a1d6f27222d4c453e6404750066e4060f72d
treec775cff3e550224e0ed197541d95afe65a0e7870
parent844d60cc5efc73da54897179418ee50a836528e6
net: annotate data-races around sk->sk_lingertime

[ Upstream commit bc1fb82ae11753c5dec53c667a055dc37796dbd2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/iso.c
net/bluetooth/sco.c
net/core/sock.c
net/sched/em_meta.c
net/smc/af_smc.c