mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Edward Adam Davis <eadavis@qq.com>
To: syzbot+cdae834448ec8c3602fe@syzkaller.appspotmail.com
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in l2cap_sock_new_connection_cb
Date: Tue, 25 Nov 2025 21:07:59 +0800	[thread overview]
Message-ID: <tencent_1BFD192ACFEF0D8BA5908DE0123C5D9CDD07@qq.com> (raw)
In-Reply-To: <6923d897.a70a0220.2ea503.0077.GAE@google.com>

#syz test

diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c
index 814fb8610ac4..20939ab32b13 100644
--- a/net/bluetooth/l2cap_sock.c
+++ b/net/bluetooth/l2cap_sock.c
@@ -1411,6 +1411,8 @@ static int l2cap_sock_shutdown(struct socket *sock, int how)
 	return err;
 }
 
+static DEFINE_MUTEX(ra_lock);
+
 static int l2cap_sock_release(struct socket *sock)
 {
 	struct sock *sk = sock->sk;
@@ -1422,9 +1424,8 @@ static int l2cap_sock_release(struct socket *sock)
 	if (!sk)
 		return 0;
 
-	lock_sock_nested(sk, L2CAP_NESTING_PARENT);
+	guard(mutex)(&ra_lock);
 	l2cap_sock_cleanup_listen(sk);
-	release_sock(sk);
 
 	bt_sock_unlink(&l2cap_sk_list, sk);
 
@@ -1473,6 +1474,7 @@ static struct l2cap_chan *l2cap_sock_new_connection_cb(struct l2cap_chan *chan)
 {
 	struct sock *sk, *parent = chan->data;
 
+	guard(mutex)(&ra_lock);
 	lock_sock(parent);
 
 	/* Check for backlog size */


  parent reply	other threads:[~2025-11-25 13:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  8:46 syzbot
2025-11-24  4:01 ` syzbot
2025-11-25 12:13   ` Edward Adam Davis
2025-11-25 12:50     ` syzbot
2025-11-25 13:07   ` Edward Adam Davis [this message]
2025-11-25 13:46     ` syzbot
2025-11-25 13:55   ` Edward Adam Davis
2025-11-25 14:54     ` 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=tencent_1BFD192ACFEF0D8BA5908DE0123C5D9CDD07@qq.com \
    --to=eadavis@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+cdae834448ec8c3602fe@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®