]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
sock_diag: annotate data-races around sock_diag_handlers[family]
authorEric Dumazet <edumazet@google.com>
Mon, 22 Jan 2024 11:25:55 +0000 (11:25 +0000)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:22 +0000 (18:19 -0400)
commit96ba0fc3b7a979c1f7670570f7a60167cda2a96b
tree9b413cbeaced0ce9b6ded11bb0e08a8108e8f7a3
parent1d938ac977b03964998be273755364e468de6243
sock_diag: annotate data-races around sock_diag_handlers[family]

[ Upstream commit efd402537673f9951992aea4ef0f5ff51d858f4b ]

__sock_diag_cmd() and sock_diag_bind() read sock_diag_handlers[family]
without a lock held.

Use READ_ONCE()/WRITE_ONCE() annotations to avoid potential issues.

Fixes: 8ef874bfc729 ("sock_diag: Move the sock_ code to net/core/")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/sock_diag.c