@@ -3474,6 +3474,7 @@ void sock_init_data_uid(struct socket *sock, struct sock *sk, kuid_t uid)
sk->sk_peer_pid = NULL;
sk->sk_peer_cred = NULL;
spin_lock_init(&sk->sk_peer_lock);
+ lock_set_cmp_fn_ptr_order(&sk->sk_peer_lock);
sk->sk_write_pending = 0;
sk->sk_rcvlowat = 1;
@@ -706,10 +706,10 @@ static void copy_peercred(struct sock *sk, struct sock *peersk)
if (sk < peersk) {
spin_lock(&sk->sk_peer_lock);
- spin_lock_nested(&peersk->sk_peer_lock, SINGLE_DEPTH_NESTING);
+ spin_lock(&peersk->sk_peer_lock);
} else {
spin_lock(&peersk->sk_peer_lock);
- spin_lock_nested(&sk->sk_peer_lock, SINGLE_DEPTH_NESTING);
+ spin_lock(&sk->sk_peer_lock);
}
old_pid = sk->sk_peer_pid;
old_cred = sk->sk_peer_cred;
Cc: netdev@vger.kernel.org Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev> --- net/core/sock.c | 1 + net/unix/af_unix.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)