mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+1683f76f1b20b826de67@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Write in hci_conn_drop (2)
Date: Sun, 18 Feb 2024 16:44:14 +0800	[thread overview]
Message-ID: <20240218084414.1254-1-hdanton@sina.com> (raw)
In-Reply-To: <00000000000026188206118a5952@google.com>

On Fri, 16 Feb 2024 18:09:19 -0800
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    2c3b09aac00d Add linux-next specific files for 20240214
> git tree:       linux-next
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=16c27a58180000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git  2c3b09aac00d

--- x/net/bluetooth/sco.c
+++ y/net/bluetooth/sco.c
@@ -297,6 +297,7 @@ static int sco_connect(struct sock *sk)
 		sco_sock_set_timer(sk, sk->sk_sndtimeo);
 	}
 
+	hci_conn_get(hcon);
 	release_sock(sk);
 
 unlock:
@@ -439,12 +440,15 @@ static void __sco_sock_close(struct sock
 	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;
--

  parent reply	other threads:[~2024-02-18  8:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-02 22:01 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
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 [this message]
2024-02-18  8:46     ` syzbot
2024-02-17 19:33 ` syzbot
     [not found] <20231103010143.3182694-1-lizhi.xu@windriver.com>
2023-11-03  3:54 ` syzbot
     [not found] <20231103051306.721321-1-lizhi.xu@windriver.com>
2023-11-03  5:23 ` syzbot
     [not found] <20231103070111.2610655-1-lizhi.xu@windriver.com>
2023-11-03  7:11 ` syzbot
     [not found] <20231103080016.3516726-1-lizhi.xu@windriver.com>
2023-11-03  8:17 ` syzbot
     [not found] <20231103121804.1421-1-hdanton@sina.com>
2023-11-03 12:43 ` syzbot
     [not found] <20231104032323.2233372-1-lizhi.xu@windriver.com>
2023-11-04  3:36 ` syzbot
     [not found] <20231104044729.2716748-1-lizhi.xu@windriver.com>
2023-11-04  5:17 ` syzbot
     [not found] <20231104054009.3030149-1-lizhi.xu@windriver.com>
2023-11-04  6:00 ` 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=20240218084414.1254-1-hdanton@sina.com \
    --to=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+1683f76f1b20b826de67@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®