]> www.infradead.org Git - linux.git/commit
af_unix: Define locking order for U_LOCK_SECOND in unix_state_double_lock().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Thu, 20 Jun 2024 20:56:14 +0000 (13:56 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 25 Jun 2024 09:10:18 +0000 (11:10 +0200)
commited99822817cb728eee8786c1c921c69c6be206fe
treedefdd84f96cc78516f7b07e5a7766cb62b65ef0a
parent3955802f160b5c61ac00d7e54da8d746f2e4a2d5
af_unix: Define locking order for U_LOCK_SECOND in unix_state_double_lock().

unix_dgram_connect() and unix_dgram_{send,recv}msg() lock the socket
and peer in ascending order of the socket address.

Let's define the order as unix_state_lock_cmp_fn() instead of using
unix_state_lock_nested().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/unix/af_unix.c