mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+1fed874be1d7e459b5a3@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bluetooth?] possible deadlock in l2cap_chan_connect (2)
Date: Wed,  7 Oct 2026 12:49:39 +0800	[thread overview]
Message-ID: <20261007044940.349-1-hdanton@sina.com> (raw)
In-Reply-To: <6ac51f8d.353c8d8e.177895.0006.GAE@google.com>

> Date: Tue, 06 Oct 2026 09:19:25 -0700
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    2c3418fffa9d Merge tag 'keys-v7.3-rc7' of git://git.kernel..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=17ca6ff5580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=929e4854a828f434
> dashboard link: https://syzkaller.appspot.com/bug?extid=1fed874be1d7e459b5a3
> compiler:       gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=101e6f25580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13cfbff5580000

#syz test

--- x/net/bluetooth/rfcomm/core.c
+++ y/net/bluetooth/rfcomm/core.c
@@ -42,6 +42,7 @@ static int channel_mtu = -1;
 
 static struct task_struct *rfcomm_thread;
 
+static DEFINE_MUTEX(rfcomm_cb_mutex);
 static DEFINE_MUTEX(rfcomm_mutex);
 #define rfcomm_lock()	mutex_lock(&rfcomm_mutex)
 #define rfcomm_unlock()	mutex_unlock(&rfcomm_mutex)
@@ -701,7 +702,9 @@ static struct rfcomm_session *rfcomm_ses
 			return NULL;
 		}
 
+	mutex_lock(&rfcomm_cb_mutex);
 	list_add(&s->list, &session_list);
+	mutex_unlock(&rfcomm_cb_mutex);
 
 	return s;
 }
@@ -743,6 +746,7 @@ static struct rfcomm_session *rfcomm_ses
 {
 	struct rfcomm_dlc *d, *n;
 
+	mutex_lock(&rfcomm_cb_mutex);
 	s->state = BT_CLOSED;
 
 	BT_DBG("session %p state %ld err %d", s, s->state, err);
@@ -754,7 +758,9 @@ static struct rfcomm_session *rfcomm_ses
 	}
 
 	rfcomm_session_clear_timer(s);
-	return rfcomm_session_del(s);
+	s = rfcomm_session_del(s);
+	mutex_unlock(&rfcomm_cb_mutex);
+	return s;
 }
 
 static struct rfcomm_session *rfcomm_session_create(bdaddr_t *src,
@@ -2220,11 +2226,11 @@ static void rfcomm_security_cfm(struct h
 
 	BT_DBG("conn %p status 0x%02x encrypt 0x%02x", conn, status, encrypt);
 
-	rfcomm_lock();
+	mutex_lock(&rfcomm_cb_mutex);
 
 	s = rfcomm_session_get(&conn->hdev->bdaddr, &conn->dst);
 	if (!s) {
-		rfcomm_unlock();
+		mutex_unlock(&rfcomm_cb_mutex);
 		return;
 	}
 
@@ -2258,7 +2264,7 @@ static void rfcomm_security_cfm(struct h
 			set_bit(RFCOMM_AUTH_REJECT, &d->flags);
 	}
 
-	rfcomm_unlock();
+	mutex_unlock(&rfcomm_cb_mutex);
 
 	rfcomm_schedule();
 }
--

  reply	other threads:[~2026-10-07  4:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 16:19 syzbot
2026-10-07  4:49 ` Hillf Danton [this message]
2026-10-07  5:10   ` 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=20261007044940.349-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+1fed874be1d7e459b5a3@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

all inboxes | Powered by JetHome®