Kuniyuki Iwashima 22e5751b05 af_unix: Don't use spin_lock_nested() in copy_peercred().
When (AF_UNIX, SOCK_STREAM) socket connect()s to a listening socket,
the listener's sk_peer_pid/sk_peer_cred are copied to the client in
copy_peercred().

Then, two sk_peer_locks are held there; one is client's and another
is listener's.

However, the latter is not needed because we hold the listner's
unix_state_lock() there and unix_listen() cannot update the cred
concurrently.

Let's drop the unnecessary spin_lock() and use the bare spin_lock()
for the client to protect concurrent read by getsockopt(SO_PEERCRED).

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-06-25 11:10:19 +02:00
..
2024-05-29 09:25:15 -07:00
2024-06-14 19:08:50 -07:00
2024-06-05 10:18:06 +01:00
2024-06-10 11:54:18 +01:00
2024-05-28 07:27:29 -07:00
2024-06-17 13:14:09 +01:00
2024-06-13 11:07:32 -07:00