public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+0e4ebcc970728e056324@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bluetooth?] KASAN: wild-memory-access Read in l2cap_connect_cfm
Date: Sat, 13 Sep 2025 12:02:51 +0800	[thread overview]
Message-ID: <20250913040256.6972-1-hdanton@sina.com> (raw)
In-Reply-To: <68c44056.a70a0220.3543fc.0036.GAE@google.com>

> Date: Fri, 12 Sep 2025 08:46:30 -0700	[thread overview]
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    590b221ed425 Add linux-next specific files for 20250912
> git tree:       linux-next
> console output: https://syzkaller.appspot.com/x/log.txt?x=161d1934580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=9134e501f17b95a4
> dashboard link: https://syzkaller.appspot.com/bug?extid=0e4ebcc970728e056324
> compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=111d1934580000

#syz test

--- x/include/net/bluetooth/l2cap.h
+++ y/include/net/bluetooth/l2cap.h
@@ -938,6 +938,7 @@ static inline long l2cap_chan_no_get_snd
 
 extern bool disable_ertm;
 extern bool enable_ecred;
+extern struct mutex cfm_mutex;
 
 int l2cap_init_sockets(void);
 void l2cap_cleanup_sockets(void);
--- x/net/bluetooth/l2cap_sock.c
+++ y/net/bluetooth/l2cap_sock.c
@@ -1411,6 +1411,7 @@ shutdown_already:
 	return err;
 }
 
+DEFINE_MUTEX(cfm_mutex);
 static int l2cap_sock_release(struct socket *sock)
 {
 	struct sock *sk = sock->sk;
@@ -1422,9 +1423,11 @@ static int l2cap_sock_release(struct soc
 	if (!sk)
 		return 0;
 
+	mutex_lock(&cfm_mutex);
 	lock_sock_nested(sk, L2CAP_NESTING_PARENT);
 	l2cap_sock_cleanup_listen(sk);
 	release_sock(sk);
+	mutex_unlock(&cfm_mutex);
 
 	bt_sock_unlink(&l2cap_sk_list, sk);
 
--- x/net/bluetooth/l2cap_core.c
+++ y/net/bluetooth/l2cap_core.c
@@ -7301,7 +7301,9 @@ next:
 		pchan = next;
 	}
 
+	mutex_lock(&cfm_mutex);
 	l2cap_conn_ready(conn);
+	mutex_unlock(&cfm_mutex);
 }
 
 int l2cap_disconn_ind(struct hci_conn *hcon)
--

  reply	other threads:[~2025-09-13  4:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17 15:57 [syzbot] [bluetooth?] KASAN: wild-memory-access Read in l2cap_connect_cfm syzbot
2025-09-12 15:46 ` syzbot
2025-09-13  4:02   ` Hillf Danton [this message]
2025-09-13  4:28     ` syzbot
2025-10-12 10:02 ` 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=20250913040256.6972-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+0e4ebcc970728e056324@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