From: syzbot <syzbot+1683f76f1b20b826de67@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] test uaf in hci_conn_drop
Date: Fri, 03 Nov 2023 20:23:27 -0700 [thread overview]
Message-ID: <000000000000f99c4606094b240c@google.com> (raw)
In-Reply-To: <000000000000e69b5a06093287ec@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: test uaf in hci_conn_drop
Author: lizhi.xu@windriver.com
#syz test git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git 8de1e7afcc1c
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 15b33579007c..f593a9f39aa9 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -6,6 +6,8 @@
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
+static void sco_set_hci_cnn_null(struct hci_conn *conn);
+
static const struct class bt_class = {
.name = "bluetooth",
};
@@ -13,6 +15,7 @@ static const struct class bt_class = {
static void bt_link_release(struct device *dev)
{
struct hci_conn *conn = to_hci_conn(dev);
+ sco_set_hci_cnn_null(conn);
kfree(conn);
}
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index c736186aba26..0a6404ba8e4b 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -76,6 +76,14 @@ struct sco_pinfo {
#define SCO_CONN_TIMEOUT (HZ * 40)
#define SCO_DISCONN_TIMEOUT (HZ * 2)
+static void sco_set_hci_cnn_null(struct hci_conn *conn)
+{
+ struct sco_conn *scn = container_of(conn, struct sco_conn, hcon);
+ sco_conn_lock(scn);
+ scn->hcon = NULL;
+ sco_conn_unlock(scn);
+}
+
static void sco_sock_timeout(struct work_struct *work)
{
struct sco_conn *conn = container_of(work, struct sco_conn,
next prev parent reply other threads:[~2023-11-04 3:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 22:01 [syzbot] [bluetooth?] KASAN: slab-use-after-free Write in hci_conn_drop (2) syzbot
2023-11-03 1:01 ` [syzbot] test uaf in hci_conn_drop syzbot
2023-11-03 5:13 ` syzbot
2023-11-03 7:01 ` syzbot
2023-11-03 8:00 ` syzbot
2023-11-04 3:23 ` syzbot [this message]
2023-11-04 4:47 ` syzbot
2023-11-04 5:40 ` syzbot
2024-02-17 2:09 ` [syzbot] [bluetooth?] KASAN: slab-use-after-free Write in hci_conn_drop (2) syzbot
2024-02-17 10:57 ` Hillf Danton
2024-02-17 11:23 ` syzbot
2024-02-18 8:44 ` Hillf Danton
2024-02-18 8:46 ` syzbot
2024-02-17 19:33 ` 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=000000000000f99c4606094b240c@google.com \
--to=syzbot+1683f76f1b20b826de67@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.