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)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 23 Jan 2024 14:13:54 +0000 (15:13 +0100)
commitefd402537673f9951992aea4ef0f5ff51d858f4b
treec91d5dace83981af7cd63b41cc96080a544be13f
parent736b5545d39ca59d4332a60e56cc8a1a5e264a8e
sock_diag: annotate data-races around sock_diag_handlers[family]

__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>
net/core/sock_diag.c