]> git.ipfire.org Git - thirdparty/linux.git/commit
net: Annotate sk->sk_write_space() for UDP SOCKMAP.
authorKuniyuki Iwashima <kuniyu@google.com>
Fri, 29 May 2026 19:39:23 +0000 (19:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 2 Jun 2026 18:44:43 +0000 (11:44 -0700)
commitb748765019fe9e9234660327090fc1a9665cdbdd
treec57f1b643237d270246cff2edd142fc9c1d9776b
parent73bf3cca7de6a73f53b6a52dc3b1c82ae5667a4d
net: Annotate sk->sk_write_space() for UDP SOCKMAP.

UDP TX skb->destructor() is sock_wfree(), and UDP holds lock_sock()
only for UDP_CORK / MSG_MORE sendmsg().

Otherwise, sk->sk_write_space() may be read locklessly while SOCKMAP
rewrites sk->sk_write_space().

Let's use WRITE_ONCE() and READ_ONCE() for sk->sk_write_space().

Note that the write side is annotated by commit 2ef2b20cf4e0
("net: annotate data-races around sk->sk_{data_ready,write_space}").

Fixes: 7b98cd42b049 ("bpf: sockmap: Add UDP support")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://patch.msgid.link/20260529193941.3897256-1-kuniyu@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/sock.c