From: syzbot <syzbot+60bfed6b415fbd1fbb87@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in __lock_sock
Date: Fri, 24 Nov 2023 17:31:09 -0800 [thread overview]
Message-ID: <0000000000000aa95b060af0069b@google.com> (raw)
In-Reply-To: <0000000000007b84a2060ac7d84b@google.com>
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: [bluetooth?] KASAN: slab-use-after-free Read in __lock_sock
Author: eadavis@qq.com
please test uaf in __lock_sock
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git 8de1e7afcc1c
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index c736186aba26..0bf3d90c1442 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -285,6 +285,7 @@ static int sco_connect(struct sock *sk)
goto unlock;
}
+ hci_conn_get(hcon);
/* Update source addr of the socket */
bacpy(&sco_pi(sk)->src, &hcon->src);
@@ -297,10 +298,12 @@ static int sco_connect(struct sock *sk)
}
release_sock(sk);
+ printk("hd: %p, hcd: %p\n", &hdev->dev, &hcon->dev);
unlock:
hci_dev_unlock(hdev);
- hci_dev_put(hdev);
+ if (err)
+ hci_dev_put(hdev);
return err;
}
@@ -438,12 +441,13 @@ static void __sco_sock_close(struct sock *sk)
case BT_CONNECTED:
case BT_CONFIG:
if (sco_pi(sk)->conn->hcon) {
+ struct hci_conn *hcon = sco_pi(sk)->conn->hcon;
sk->sk_state = BT_DISCONN;
sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
sco_conn_lock(sco_pi(sk)->conn);
- hci_conn_drop(sco_pi(sk)->conn->hcon);
sco_pi(sk)->conn->hcon = NULL;
sco_conn_unlock(sco_pi(sk)->conn);
+ hci_conn_put(hcon);
} else
sco_chan_del(sk, ECONNRESET);
break;
next prev parent reply other threads:[~2023-11-25 1:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <tencent_370274657663662E3C37373E97B236864A09@qq.com>
2023-11-23 1:35 ` [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in __lock_sock syzbot
2023-11-23 2:06 ` syzbot
2023-11-23 3:19 ` syzbot
2023-11-24 11:29 ` syzbot
2023-11-24 11:41 ` syzbot
2023-11-24 13:54 ` syzbot
2023-11-25 1:31 ` syzbot [this message]
2023-11-25 3:20 ` syzbot
[not found] <tencent_148DEA923ADD925D92193DCF888DACA5B807@qq.com>
2023-11-25 3:47 ` syzbot
[not found] <tencent_10DE52D4065BC98B6EC92ECCCCB3E7C34606@qq.com>
2023-11-25 1:58 ` syzbot
[not found] <tencent_8E3BCF900DCF25FA0DA212145DC45DDF1907@qq.com>
2023-11-24 14:36 ` syzbot
[not found] <tencent_38DDEF5DB0192CCFD60D8BA5AA8DA1924107@qq.com>
2023-11-24 12:22 ` syzbot
[not found] <tencent_ABBB2A33F49E801B384B7B1BC02538BA4A08@qq.com>
2023-11-24 11:56 ` syzbot
[not found] <tencent_93DC466109A02ECE6EC20CAE67D5C6CCD206@qq.com>
2023-11-23 14:27 ` syzbot
[not found] <tencent_D3FF464CC98C2ED92ED18C9367E746E65206@qq.com>
2023-11-23 3:06 ` syzbot
2023-11-23 1:14 syzbot
-- strict thread matches above, loose matches on Subject: below --
2023-11-22 15:43 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=0000000000000aa95b060af0069b@google.com \
--to=syzbot+60bfed6b415fbd1fbb87@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox