]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
bpf, sockmap: Annotate af_unix sock:: Sk_state data-races
authorMichal Luczaj <mhal@rbox.co>
Tue, 14 Apr 2026 14:13:15 +0000 (16:13 +0200)
committerMartin KaFai Lau <martin.lau@kernel.org>
Thu, 16 Apr 2026 00:22:42 +0000 (17:22 -0700)
commita25566084e391348385a72dd507e0cc0c268dd5d
treec92342112d5260c5550d86ea3b545d7d0f076ad3
parent9d8e92e15f75794c469f586a2c47fab58f093a3a
bpf, sockmap: Annotate af_unix sock:: Sk_state data-races

sock_map_sk_state_allowed() and sock_map_redirect_allowed() read af_unix
socket sk_state locklessly.

Use READ_ONCE(). Note that for sock_map_redirect_allowed() change affects
not only af_unix, but all non-TCP sockets (UDP, af_vsock).

Suggested-by: Kuniyuki Iwashima <kuniyu@google.com>
Suggested-by: Martin KaFai Lau <martin.lau@linux.dev>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20260414-unix-proto-update-null-ptr-deref-v4-1-2af6fe97918e@rbox.co
net/core/sock_map.c