sock_diag: allow concurrent operation in sock_diag_rcv_msg()
authorEric Dumazet <edumazet@google.com>
Mon, 22 Jan 2024 11:26:01 +0000 (11:26 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 23 Jan 2024 14:13:55 +0000 (15:13 +0100)
commit86e8921df05c6e9423ab74ab8d41022775d8b83a
treea6c150098e8ac43e8a0c28de2d6ef03fac6549db
parent1d55a6974756cf3979efd2cc68bcece611a44053
sock_diag: allow concurrent operation in sock_diag_rcv_msg()

TCPDIAG_GETSOCK and DCCPDIAG_GETSOCK diag are serialized
on sock_diag_table_mutex.

This is to make sure inet_diag module is not unloaded
while diag was ongoing.

It is time to get rid of this mutex and use RCU protection,
allowing full parallelism.

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>
include/linux/sock_diag.h
net/core/sock_diag.c
net/ipv4/inet_diag.c