On Sat, Feb 21, 2026 at 11:30 PM GMT, Kuniyuki Iwashima wrote:
UDP TX skb->destructor() is sock_wfree(), and UDP only
holds lock_sock() for UDP_CORK / MSG_MORE sendmsg().
Otherwise, sk->sk_write_space() is read locklessly.
Let's use WRITE_ONCE() and READ_ONCE() for sk->sk_write_space().
Fixes: 7b98cd42b049 ("bpf: sockmap: Add UDP support")
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
v3: Use WRITE_ONCE() in udp_bpf_update_proto()
v2: Cache sk->sk_write_space in sock_wfree()
---
I agree with Jiayuan that it would be less confusing to drop the
overlapping parts but Eric's patch went through net tree and this is
targeted for bpf tree (?). I'm actually not sure what exactly the
bpf/net target signifies.
So if it makes everyone's life easier:
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>