]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 6 Jul 2025 09:00:10 +0000 (11:00 +0200)
commitfd3af69c14ed0611910ecae8d60dbb084af51a25
tree1c2cd2020c9b32f7fd4821581be0fa2ae2ca3856
parentb7904e2fccd0543d1862fb47d32274653145cb40
af_unix: Define locking order for U_LOCK_SECOND in unix_state_double_lock().

[ Upstream commit ed99822817cb728eee8786c1c921c69c6be206fe ]

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>
Stable-dep-of: 32ca245464e1 ("af_unix: Don't leave consecutive consumed OOB skbs.")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/unix/af_unix.c