From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.6.135.218 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796077168; b=urBtRMD7GcHfiDs0EXJe5aUJbamyEIFXFlK3EIxbmduxBpolTOJCKcS3/jERR+ThcRTz 28yY/+dBiFSauyPTzRJFnZbQIVaZ9eGqutVtuFtgh9Kas2RcVEpwpUvwL4oJtrC6qq7Vv bsBByKpk41TVh1bQGUaS7omkqLFeFbmVvO0fjZdFqcdjSkDnS0RgYt+rslXDoseqskCmg ZVsP0va8xnX+6WzBtyPquEiRUpdoKM2xh2x9TwHBtKiTsq7pCUFL4UaZM6i4iDm3gjjDH wuFmtvO3YSsRDFFKflPboPJJpzfgxYjF1ovEgiMOtClgSL81XKaG53v7CSjJBKdtPig== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796077168; h=DMARC-Filter:DKIM-Signature:X-SONIC-DKIM-SIGN:X-YMail-OSG:X-Sonic-MF: X-Sonic-ID:Received:Received:From:To:Cc:Subject:Date:Message-ID: X-Mailer:MIME-Version:Content-Transfer-Encoding:References; bh=l+8WGSlI9mfSEu4i7akS7NW8kSf3CMa+9ljz0SpnjPQ=; b=2lxQnlQ+YoX+OXOeL8VQD6j78wlQ/EMcqpIokjDb7ZBYLqzVoxp8J4y8vIn/roQceVAv ys5vMDeDQAAN3tm0JNVWHGFNw+cWs1AbG9d0Q43BD6kdgzITsY3ql5jjJo0YfTvnoBeQF GS7D2+B3OD928dnDR9iphl/Uksn60XU4n5IK6B/K2oabgnYVKe5s0fLpn095OkCs5AzY+ PZXxYh6DEJzZOefDQkus7T8BpwkcQiqS5XZXfUCHxwfqau4aWLXoUXPaQuz2Uyx0gV8Kr BHGBhsMlDurE6dbxlNa94K1/8GiNtmDbXJQ70KK+9TINycgnbSgGnB9tPfw6sZQfI7w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=Pff3e22G; arc=none smtp.remote-ip=74.6.135.218 Received: from sonic310-44.consmr.mail.bf2.yahoo.com (sonic310-44.consmr.mail.bf2.yahoo.com [74.6.135.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB04F606A31A for ; Mon, 30 Nov 2026 22:19:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org EB04F606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=Pff3e22G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796077166; bh=l+8WGSlI9mfSEu4i7akS7NW8kSf3CMa+9ljz0SpnjPQ=; h=From:To:Cc:Subject:Date:References:From:Subject:Reply-To:Content-Type; b=Pff3e22GmAVPo0qLPo7KrbfLQWk79n83FjDTgMRdhDOJCgoXzL/kpTyK7dqbF9tdBRx+5s2bcPOfEWoTDA31ILRJ6lL3rupvp1YuHj5KtnDDhPL2ZMFAZ2W1R2XmEbRDRdklUghQm8I5NJattbMChjqX3ZJNrhE2nVxJPJ+Hqib2PZsb8arb6/rZXS63JOqQG8KPm3hvU83FkuVg8q6wFsW1wysPK0EMV2EN5R7TTzalS4AejMxrqOP47peeOpf6hy4X1dz+24hdrPEqxLl/Yt1VWAKivgYRr0t8ZmYwRKmuy6pXonpES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9U v222I.VRd4hd3CFSaFCA703CdHJndAaINbWmrdsgGmCkCagZ8DqwMgoRPjwVQcBfzMWerxZx1iPi 3aECCSJK.tsIMUq9vMh_cnzcyVpwG1U8H3LLt13UJOMuzTjwldbJs820qnLN0y3aYWKen6E1MbjX nBontwRIVI0FGm3gm8IXYT8H.CQnF8s_0ZalKOpRrPcn2BFyx_5U1J39U7M99yBGXJPqlBh4sCed Ba4gxyRzljFIZd.yKPN2gWZQFBUoeqDRCliFfVErNQ6.N5MVuHpg6.oca1wKGMdTCIdfJDL_PRL. 33wpBA2zH93aXe3YnyxnnhTZEpxLEArh4_QY8t8AZBcj3HhqntdOj3_gP5_LGJ6XPu6WJa3znBGu 3TM8InNMEyxso9Okiuv3bgJhtMVfoqL0ueeCsZTdeWQk9sYGL7JU4gX6A986h8Yixl7rHogvzN12 KKFV7k2H.26RfoTbXs0gRRPF5M5DoAp3MBCh7.AZLd2HDQHCT9d1Mm3yAwgkjTPIO2WwMvOCc816 HjLFq3SxiItXVQofLaOH6MCiFwjUIg.A.gKjq1hfK4abrkiSYVRdcQTbvztL8khePqpTwjtuLCHM zTmF6A98axCPFTqxnpFvcrqIU_NelOTe0Fi10gUIh4asJG2fZ7aqPsKBAf3YRvlJOjW9vWHpAezw xTo6qf44bXwWhEZ25zlDL1XWeanrhaQCcxpvTaVAVRru9XvB.8V.SrWnVZiQ5g8e6v1dP4lCvCP8 3zIJwhlobElEBYPtX.488VgK3KZjncxq25WhjObN9EqGcrjWQGAdefjDfCFo- X-Sonic-MF: X-Sonic-ID: d8f7e53e-0909-44f8-a503-d995589fac00 Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.bf2.yahoo.com with HTTP; Mon, 30 Nov 2026 22:19:26 +0000 Received: by hermes--production-ne1-768f77cf86-gkh7p (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID ec03205d60477dd70c69400a92f24405; Mon, 30 Nov 2026 22:17:25 +0000 (UTC) From: Jeremy Dean Clifton To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Dean Clifton , syzbot+fc4b5b2477d4ca272907@syzkaller.appspotmail.com Subject: [PATCH] Bluetooth: hci_event: Ignore Authentication Complete for non-ACL links Date: Mon, 30 Nov 2026 22:17:22 +0000 Message-ID: <20261130221722.530577-1-deaner92@yahoo.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit References: <20261130221722.530577-1-deaner92.ref@yahoo.com> Authentication Complete is only defined for BR/EDR (ACL) links, but hci_auth_complete_evt() looks the connection up by handle and does not check its type. If a controller sends the event with the handle of an LE link, the ACL completion code runs on the LE link. For an ACL link still in BT_CONFIG, that code drops the reference hci_conn_complete_evt() took when setup started. An LE link in BT_CONFIG never took that reference; the one that keeps it alive during setup belongs to the remote features request started by hci_le_read_remote_features() and is dropped by le_read_features_complete(). The event therefore drops a reference the LE link does not have, and refcnt stays one below the number of holders. If it reaches zero early, disc_work is queued, and once the last holder drops its reference, whether le_read_features_complete() or another user such as an L2CAP channel added by __l2cap_chan_add(), refcnt goes to -1 and hci_conn_timeout() warns: WARNING: net/bluetooth/hci_conn.c:631 at hci_conn_timeout+0x16a/0x230 Workqueue: hci0 hci_conn_timeout Before commit a106e50be74b ("Bluetooth: HCI: Add support for LL Extended Feature Set"), the LE reference was dropped by the LE Read Remote Features command status and completion handlers, and only while the link was still in BT_CONFIG, which this event had already cleared, so the extra drop did not make refcnt negative. That commit moved the drop to le_read_features_complete(), which drops it unconditionally. A controller that follows the specification never sends this event for an LE handle, but the kernel should not corrupt its own state when one does. Ignore the event for any link type other than ACL before it changes the connection's state or references. ACL handling is unchanged. Tested on arm64 under QEMU with the syzbot C reproducer on bluetooth-next, with a temporary WARN in hci_conn_drop() when refcnt goes negative. Without this patch it fired within the first second (337 times, all on an LE link with handle 0 in BT_CONFIG); with it, it did not fire in 300 seconds, and the ignored events were logged. The reproducer sends the event every few milliseconds, and each hci_conn_hold() cancels disc_work, so the hci_conn_timeout() warning itself was not seen locally. Fixes: a106e50be74b ("Bluetooth: HCI: Add support for LL Extended Feature Set") Reported-by: syzbot+fc4b5b2477d4ca272907@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=fc4b5b2477d4ca272907 Assisted-by: Claude:claude-opus-5-5 Signed-off-by: Jeremy Dean Clifton --- net/bluetooth/hci_event.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index a9b6a6ccaa03..55aa714c4d39 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -3684,6 +3684,17 @@ static void hci_auth_complete_evt(struct hci_dev *hdev, void *data, if (!conn) goto unlock; + /* Authentication Complete is only defined for BR/EDR links. An LE + * link in BT_CONFIG has not taken the reference that the BT_CONFIG + * branch below drops, so letting a misbehaving controller report it + * for an LE handle makes conn->refcnt go negative. + */ + if (conn->type != ACL_LINK) { + bt_dev_err_ratelimited(hdev, "Ignoring Authentication Complete for non-ACL handle 0x%4.4x", + __le16_to_cpu(ev->handle)); + goto unlock; + } + if (!ev->status) { clear_bit(HCI_CONN_AUTH_FAILURE, conn->flags); set_bit(HCI_CONN_AUTH, conn->flags); -- 2.43.0