From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385102; b=G/87Eb2ByJWFHvSpXkYcGlTledwzHWRysMNqD283uTj4WwUwzFl2DHXNiFLfGeSqrVNB +EV+DY1ZIScKOXqjXngRj+KONTZp0VATLYaVGkhuOn7fkSkR2yxFsdwlM1Ma439Fginmj +0bNX18Sc4J4orIGStBgkuBgKPw9qeWuqHBg1taHzFxNgL89cIUzEZTCeO4GsYo7CPtJS dzf1GPzLTtR+2FtXzilb/kHGsjg6NK7J02jxqxOPdvZ/Jo9XZQvR4Sn1cvZYH8yeUv1vH hwHFgEYOZ2tJ1iX8ZnDP3BS3f3PIwPuY6ML+FCmQy4w5K3DQnVlHVZ2n/zdqnrTogoA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385102; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=1DP8a/nmf1MFJTlAld3GF6YttwxIJQVROU98Xktj1QU=; b=EJo9su1EFARzQQtuX2MSrWYyiFFwvweEQXlpW+cFLERQEDoJMNWx346s/tSZ8RkWrCGz CDHQ9bJ3iEZ+ir7kqAi6z5jHkV2e7VMqZsbjBmdUg5vVNmAgTpgP7fvMlOeWcH+i1eeda keFRIlU2OU+5iV/lJyFem/gbN9DGS93B/DBpHyuNJgtvSBzRF4EYr98Beh4iS5gV4n2+9 WinT4fG/xOXy/oDopdJnaYIUR80IDFb/kh8K+16/ZDsh+tYCPC882ZjQTszou1JZhdnUk BpFmZpqyu8quuMPWc6hj2ydGgxc30irOtFMwcewnzYDMtGQ7mruzeSsvOuzXhPxqrAA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="OXLIZ1j/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F277606A32D; Fri, 4 Dec 2026 11:51:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=OXLIZ1j/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BA651F00897; Fri, 4 Dec 2026 11:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385101; bh=1DP8a/nmf1MFJTlAld3GF6YttwxIJQVROU98Xktj1QU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=OXLIZ1j/CL+fBsJze5du8hmNZqbJPiVsRcmKtbKpXcL/OD+Yl4bGH0wY/Qt1kSb/s ZWT9AclpjB6VzyKw+81R8z/H4MgqN87nAQCyPwxxvJF9b1plCw4upIgSPvbwuGHvIl qqtSlWvGWg2LFr1NxFjsAWTuj7htKjzY62tFUaVo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kevin Dewald , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.6 0412/1167] Bluetooth: hci_event: Fix LE link drop on remote features command status Date: Fri, 4 Dec 2026 18:57:19 +0900 Message-ID: <20261204100712.757002112@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kevin Dewald [ Upstream commit 91638f53ff2b8234195ff27ec913e068269a28e9 ] When the local controller supports peripheral-initiated features exchange, the LE Read Remote Features procedure also runs for incoming connections, and it fails with Unsupported Remote Feature (0x1a) if the central does not support that feature. hci_le_remote_feat_complete_evt() and hci_le_read_all_remote_features_evt() handle this and let the connection transition into connected state. A controller can also return that error in the Command Status event instead. An Intel controller does so for a central that does not support peripheral-initiated features exchange, presumably because it already has the features of the central. hci_cs_le_read_remote_features() and hci_cs_le_read_all_remote_features() then confirm the connection as failed while it is still in BT_CONFIG, and the hci_conn_drop() in le_read_features_complete() disconnects it right away: > HCI Event: LE Meta Event (0x3e) plen 31 LE Enhanced Connection Complete (0x0a) Status: Success (0x00) Role: Peripheral (0x01) < HCI Command: LE Read Remote Used Features (0x08|0x0016) plen 2 > HCI Event: Command Status (0x0f) plen 4 LE Read Remote Used Features (0x08|0x0016) ncmd 1 Status: Unsupported Remote Feature / Unsupported LMP Feature (0x1a) < HCI Command: Disconnect (0x01|0x0006) plen 3 Reason: Remote User Terminated Connection (0x13) Data the central sends afterwards is reported as: Bluetooth: hci0: ACL packet for unknown connection handle 3585 Handle Unsupported Remote Feature in the command status the same way as in the complete events. Fixes: 0fe29fd1cd77 ("Bluetooth: Read LE remote features during connection establishment") Fixes: a106e50be74b ("Bluetooth: HCI: Add support for LL Extended Feature Set") Assisted-by: Claude:claude-opus-5.5 Signed-off-by: Kevin Dewald Signed-off-by: Luiz Augusto von Dentz [ sashal: Dropped the hunk for the missing all-remote-features handler and added the fix inside the older nested if (conn) / BT_CONFIG structure, keeping its existing hci_conn_drop(). ] Signed-off-by: Sasha Levin --- net/bluetooth/hci_event.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index af1592b82d299..4bdf1199dbb16 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2886,6 +2886,22 @@ static void hci_cs_le_read_remote_features(struct hci_dev *hdev, u8 status) conn = hci_conn_hash_lookup_handle(hdev, __le16_to_cpu(cp->handle)); if (conn) { if (conn->state == BT_CONFIG) { + /* If the local controller supports peripheral-initiated + * features exchange, but the remote controller does not, + * then the controller may already return the error code + * 0x1a for unsupported remote feature in the command + * status. + * + * Handle it as hci_le_remote_feat_complete_evt() does and + * allow the connection to transition into connected state. + */ + if (!conn->out && + status == HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE && + (hdev->le_features[0] & HCI_LE_PERIPHERAL_FEATURES)) { + conn->state = BT_CONNECTED; + status = 0x00; + } + hci_connect_cfm(conn, status); hci_conn_drop(conn); } -- 2.53.0