public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+e953a8f3071f5c0a28fd@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [net?] possible deadlock in gtp_encap_enable_socket
Date: Sat,  5 Oct 2024 17:28:12 +0800	[thread overview]
Message-ID: <20241005092812.2152-1-hdanton@sina.com> (raw)
In-Reply-To: <66f18d50.050a0220.c23dd.0012.GAE@google.com>

On Mon, 23 Sep 2024 08:46:24 -0700
> syzbot found the following issue on:
> 
> HEAD commit:    9410645520e9 Merge tag 'net-next-6.12' of git://git.kernel..
> git tree:       net-next
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=110c6c27980000

#syz test

--- x/net/smc/af_smc.c
+++ y/net/smc/af_smc.c
@@ -3053,9 +3053,7 @@ int smc_setsockopt(struct socket *sock,
 	/* generic setsockopts reaching us here always apply to the
 	 * CLC socket
 	 */
-	mutex_lock(&smc->clcsock_release_lock);
 	if (!smc->clcsock) {
-		mutex_unlock(&smc->clcsock_release_lock);
 		return -EBADF;
 	}
 	if (unlikely(!smc->clcsock->ops->setsockopt))
@@ -3067,7 +3065,6 @@ int smc_setsockopt(struct socket *sock,
 		sk->sk_err = smc->clcsock->sk->sk_err;
 		sk_error_report(sk);
 	}
-	mutex_unlock(&smc->clcsock_release_lock);
 
 	if (optlen < sizeof(int))
 		return -EINVAL;
@@ -3133,19 +3130,15 @@ int smc_getsockopt(struct socket *sock,
 		return __smc_getsockopt(sock, level, optname, optval, optlen);
 
 	smc = smc_sk(sock->sk);
-	mutex_lock(&smc->clcsock_release_lock);
 	if (!smc->clcsock) {
-		mutex_unlock(&smc->clcsock_release_lock);
 		return -EBADF;
 	}
 	/* socket options apply to the CLC socket */
 	if (unlikely(!smc->clcsock->ops->getsockopt)) {
-		mutex_unlock(&smc->clcsock_release_lock);
 		return -EOPNOTSUPP;
 	}
 	rc = smc->clcsock->ops->getsockopt(smc->clcsock, level, optname,
 					   optval, optlen);
-	mutex_unlock(&smc->clcsock_release_lock);
 	return rc;
 }
 
--

  parent reply	other threads:[~2024-10-05  9:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-23 15:46 [syzbot] [net?] possible deadlock in gtp_encap_enable_socket syzbot
2024-10-01  0:57 ` [syzbot] test syzbot
2024-10-05  2:39 ` [syzbot] patch test syzbot
2024-10-05  9:28 ` Hillf Danton [this message]
2024-10-05  9:57   ` [syzbot] [net?] possible deadlock in gtp_encap_enable_socket syzbot
2024-10-30 12:02 ` Pablo Neira Ayuso
2025-05-12 16:08 ` syzbot
2025-05-12 22:10   ` Kuniyuki Iwashima
     [not found] <CAGiJo8TzPyoxUoTV=48uowQPPywbCZ6X1fRRF5KGYFJyhkY5_A@mail.gmail.com>
2024-10-01  1:20 ` syzbot
     [not found] <CAGiJo8QbFa1ygs7e3T8uZbvRb+e-+Eu8UBef1k6ZLkr5eJ3x1Q@mail.gmail.com>
2024-10-05  3:36 ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241005092812.2152-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+e953a8f3071f5c0a28fd@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox