net: make sk->sk_sndtimeo lockless
authorEric Dumazet <edumazet@google.com>
Fri, 20 Jun 2025 15:55:35 +0000 (15:55 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 24 Jun 2025 00:05:11 +0000 (17:05 -0700)
commit3169e36ae14802b01abe4bfa7ec593b0a1af5cc7
treecf5e5c786662af907bf4cfef42b736493a00fe6b
parent0fd9e5958ebb41188700b566467a1d9a3ebcdece
net: make sk->sk_sndtimeo lockless

Followup of commit 285975dd6742 ("net: annotate data-races around
sk->sk_{rcv|snd}timeo").

Remove lock_sock()/release_sock() from sock_set_sndtimeo(),
and add READ_ONCE()/WRITE_ONCE() where it is needed.

Also SO_SNDTIMEO_OLD and SO_SNDTIMEO_NEW can call sock_set_timeout()
without holding the socket lock.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250620155536.335520-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sock.h
net/bluetooth/iso.c
net/bluetooth/l2cap_sock.c
net/bluetooth/sco.c
net/core/sock.c
net/sctp/socket.c
net/smc/af_smc.c