From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp153-163.sina.com.cn (smtp153-163.sina.com.cn [61.135.153.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2DA9BA3D for ; Mon, 2 Feb 2026 01:13:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=61.135.153.163 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769994830; cv=none; b=m9RGmtM4QoCIMmAVSVZvi1BFmnpVmUAklbeEds6MuMeICHsCcNF2qcpEI8QOv5mmhJJZPXXyhy2yzjTs3ZqYhAhT+oWEZ5wOysJk1yitARoWrrOLZ+EXZ8cu1pv/m2YIDCsDhDiLSACtERUHve6M/6QFqeBHOi/1kVU4klq8x4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769994830; c=relaxed/simple; bh=OvztgS4BXfUutM2QZbOcJstWSEN36DrtwGyjxd2EFik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z5xjElSPpkttr+KhDS3TrBmLSA3k87qUT+2wgCSoGZ7MUDftr47jS+ZEowXVCZpynzq27n9rLmzeu6iCvlZjt0xi7vC6jK8MkaecNSeDhdUeDsu9RdED42K7gizVEXpLfq1nJQPgwVDtVn6dus4ErwPvzmxyaDYoyXe6VYNoCyg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b=caCgWZ1k; arc=none smtp.client-ip=61.135.153.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=sina.com header.i=@sina.com header.b="caCgWZ1k" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sina.com; s=201208; t=1769994823; bh=mgNww1x6USnCl3xgeRt+n4jo9pFNIQ6+VadlUdNq7Rg=; h=From:Subject:Date:Message-ID; b=caCgWZ1kdpcJ+G3/moWOIGt+VdQY2iUwD4L3rOh/+SkhHlCufuUM68xCM8CpB0UoG o912vXwqKjq5XPMOhLjg4XDHiMPuYzu/Kqa3X3VRNnMtxMJHlMZOmfzHmrLdx3gUKm PO5N12lCseK+/Vpf0oxA4RtMger+oMBtPoaPLXSE= X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([114.249.62.144]) by sina.com (10.54.253.32) with ESMTP id 697FFA1D0000441A; Mon, 2 Feb 2026 09:13:03 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 1783434456617 X-SMAIL-UIID: 84F6647861DA4CB8B1127D81D991C40B-20260202-091303-1 From: Hillf Danton To: syzbot Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Subject: Re: [syzbot] [bluetooth?] WARNING in hci_connect_sco Date: Mon, 2 Feb 2026 09:12:49 +0800 Message-ID: <20260202011251.2533-1-hdanton@sina.com> In-Reply-To: <697e08a4.050a0220.16b13.0092.GAE@google.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit > Date: Sat, 31 Jan 2026 05:50:28 -0800 > syzbot has found a reproducer for the following issue on: > > HEAD commit: ad9a728a3388 Merge tag 'for-linus-iommufd' of git://git.ke.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=15513c5a580000 > kernel config: https://syzkaller.appspot.com/x/.config?x=f1fac0919970b671 > dashboard link: https://syzkaller.appspot.com/bug?extid=5897b3c764f5989ea942 > compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44 > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17b45322580000 #syz test --- x/include/net/bluetooth/hci_core.h +++ y/include/net/bluetooth/hci_core.h @@ -1687,6 +1687,7 @@ static inline void hci_conn_drop(struct if (atomic_dec_and_test(&conn->refcnt)) { unsigned long timeo; + struct hci_dev *hdev; switch (conn->type) { case ACL_LINK: @@ -1707,8 +1708,14 @@ static inline void hci_conn_drop(struct } cancel_delayed_work(&conn->disc_work); - queue_delayed_work(conn->hdev->workqueue, - &conn->disc_work, timeo); + hdev = conn->hdev; + rcu_read_lock(); + if (test_bit(HCI_RESET, &hdev->flags) || + hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE)) + ; + else + queue_delayed_work(hdev->workqueue, &conn->disc_work, timeo); + rcu_read_unlock(); } } --- x/net/bluetooth/hci_sync.c +++ y/net/bluetooth/hci_sync.c @@ -5307,10 +5307,13 @@ int hci_dev_close_sync(struct hci_dev *h cancel_delayed_work_sync(&adv_instance->rpa_expired_cb); } + hci_dev_set_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE); + synchronize_rcu(); /* Avoid potential lockdep warnings from the *_flush() calls by * ensuring the workqueue is empty up front. */ drain_workqueue(hdev->workqueue); + hci_dev_clear_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE); hci_dev_lock(hdev); --