mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+0cece8fa7d83523f47a3@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] Bluetooth: RFCOMM: avoid socket lock inversion in listener cleanup
Date: Sat, 12 Sep 2026 13:49:40 -0700	[thread overview]
Message-ID: <6aa5bae4.f81106d8.2ab401.0030.GAE@google.com> (raw)
In-Reply-To: <6aa2d63e.6e6c5f9e.28f11f.0036.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] Bluetooth: RFCOMM: avoid socket lock inversion in listener cleanup
Author: jcperdomo100@gmail.com

#syz test

rfcomm_sock_cleanup_listen() closes unaccepted child sockets through
rfcomm_sock_close(), which takes the RFCOMM socket lock before
rfcomm_dlc_close() acquires rfcomm_mutex.

The RFCOMM worker takes these locks in reverse order: it holds
rfcomm_mutex while rfcomm_connect_ind() or a DLC state callback acquires
an RFCOMM socket lock. Lockdep therefore reports a possible deadlock.

Remove the redundant socket locking from rfcomm_sock_close(). Its only
caller receives the dequeued child with a reference held, and the
function is already documented as requiring an unlocked socket. This
also matches rfcomm_sock_shutdown(), which drops the socket lock before
closing the DLC.

Reported-by: syzbot+0cece8fa7d83523f47a3@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=0cece8fa7d83523f47a3
Fixes: b7ce436a5d79 ("Bluetooth: switch to lock_sock in RFCOMM")
Signed-off-by: Juan Perdomo <jcperdomo100@gmail.com>
---
 net/bluetooth/rfcomm/sock.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 958081adb..1a35fb5fd 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -242,9 +242,7 @@ static void __rfcomm_sock_close(struct sock *sk)
  */
 static void rfcomm_sock_close(struct sock *sk)
 {
-	lock_sock(sk);
 	__rfcomm_sock_close(sk);
-	release_sock(sk);
 }
 
 static void rfcomm_sock_init(struct sock *sk, struct sock *parent)
-- 
2.50.1 (Apple Git-155)

  reply	other threads:[~2026-09-12 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 16:09 [syzbot] [bluetooth?] possible deadlock in rfcomm_dlc_close syzbot
2026-09-12 20:49 ` syzbot [this message]
2026-09-13  1:51 ` Forwarded: [PATCH v2] Bluetooth: RFCOMM: avoid socket lock inversion in listener cleanup syzbot
2026-09-13  3:09 ` Juan Perdomo

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=6aa5bae4.f81106d8.2ab401.0030.GAE@google.com \
    --to=syzbot+0cece8fa7d83523f47a3@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®