summaryrefslogtreecommitdiff
path: root/net/strparser/strparser.c
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2025-06-20 15:55:36 +0000
committerJakub Kicinski <kuba@kernel.org>2025-06-23 17:05:12 -0700
commit935b67675a9f233aa4ac4ae6452b2cc45418d839 (patch)
treee20347e07374de053e0dac18a6d49364a8823660 /net/strparser/strparser.c
parent3169e36ae14802b01abe4bfa7ec593b0a1af5cc7 (diff)
net: make sk->sk_rcvtimeo lockless
Followup of commit 285975dd6742 ("net: annotate data-races around sk->sk_{rcv|snd}timeo"). Remove lock_sock()/release_sock() from ksmbd_tcp_rcv_timeout() and add READ_ONCE()/WRITE_ONCE() where it is needed. Also SO_RCVTIMEO_OLD and SO_RCVTIMEO_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-3-edumazet@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/strparser/strparser.c')
-rw-r--r--net/strparser/strparser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/strparser/strparser.c b/net/strparser/strparser.c
index d946bfb424c7..43b1f558b33d 100644
--- a/net/strparser/strparser.c
+++ b/net/strparser/strparser.c
@@ -333,7 +333,7 @@ static int strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb,
struct strparser *strp = (struct strparser *)desc->arg.data;
return __strp_recv(desc, orig_skb, orig_offset, orig_len,
- strp->sk->sk_rcvbuf, strp->sk->sk_rcvtimeo);
+ strp->sk->sk_rcvbuf, READ_ONCE(strp->sk->sk_rcvtimeo));
}
static int default_read_sock_done(struct strparser *strp, int err)