Re: [PATCH net v1] raw: annotate disconnect-side IPv4 match writers
From: Eric Dumazet
Date: Fri Aug 28 2026 - 11:52:39 EST
On Fri, Aug 28, 2026 at 3:29 AM Xuanqiang Luo <xuanqiang.luo@xxxxxxxxx> wrote:
>
> From: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
>
> raw_v4_match() reads inet_daddr, inet_rcv_saddr and
> sk_bound_dev_if locklessly under RCU. Bind and connect writers are
> annotated, but __udp_disconnect() still clears the same fields using
> plain stores.
>
> Commit 18f116931f52e ("raw: annotate lockless match fields in
> raw_v4_match()") added the lockless readers and annotated the raw bind
> and datagram connect writers. Its v4 revision intentionally left the
> shared disconnect-side IPv4 writers for follow-up cleanup.
>
> Complete that follow-up by using WRITE_ONCE() for the disconnect-side
> stores, including the inet_rcv_saddr reset in inet_reset_saddr(), to
> pair with the lockless raw socket matcher.
>
> Fixes: 0daf07e52709 ("raw: convert raw sockets to RCU")
> Link: https://lore.kernel.org/netdev/20260716142958.3064224-1-runyu.xiao@xxxxxxxxxx/
> Suggested-by: Runyu Xiao <runyu.xiao@xxxxxxxxxx>
> Signed-off-by: Jackie Liu <liuyun01@xxxxxxxxxx>
> Signed-off-by: Xuanqiang Luo <luoxuanqiang@xxxxxxxxxx>
Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>