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=1796387873; b=vozM3bJSJNQtS5Yf//WuPsJjt/Y8QtAvlyQEAqgAAyq16GXEwFP8G3TnJLoGDlajK52Y otov6O05yg+MNcLkD3NDEarjmGPcPKszkWrLscgfGbJp2TjygxAkcZt0UvqcKk4fLSQHZ 03WaZ0wth4kJdeDYtEB60VzZNl9Oa9JYljk51/z896VFdyEcgRBJXo2fqxt7riddLtLgH wczWMP93unt+jqQK4HbdzkX4+eE9OfuhT6i+hBu9SqSiEhKOdhFwH/IoZSa/VmrvZWE67 V1jstNVp1SjU4CYTLyIUImGBy8wg2gL2Ch1JNYo4rbcQTZMNakOhxmikoKhIM3Wp7FA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387873; 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=nEfWttnuIKPwuJEp7BS4JZC2AtHSxPXD82kH7YZg06Q=; b=WjdbhKjHWVcCK+yXQvYJfo1XCJ3cKE4/kiop9u9QwOe76rRnJn0hMi2IjmubtgQeGXqD KxcU6fYxoAA01XT3/fyIB8b00h9ZUvBbuCmcH+oTcyc7V4584Pknp//9/VMX9jFw8kRyH JixAks5ZrP3UUBYbrGQNi7UiNNjEQ1dQ+K2ghmEfw8pSEMHuarsRd7+nMIUWnhHtP1xuh 1BklQ6AN7cvzXhoYBTESKlfZjkP52HVDFXRuI/Bh5JfBEpS3LDfZ+c3miysfYoEHo1OrK frnQp6f8zPOyvyolJT8rUvAmPgF5gIDsZasScGIo8u5CeaepoYMl5PAx++1l/JiLPcg== 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=QVLDcnro; 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 F0874606A322; Fri, 4 Dec 2026 12:37:52 +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=QVLDcnro Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A7791F000C2; Fri, 4 Dec 2026 12:37:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387872; bh=nEfWttnuIKPwuJEp7BS4JZC2AtHSxPXD82kH7YZg06Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QVLDcnroP6hWEhk5fqIUIrwpp0DQd5/GfHn8tV2MHYqbEAz7qrN9I1N07xY8tO67k ju8WHS+mxfowlGMfh6WBBkX5ol/MBM2Y82ST6d2wj6UZYtST6au9kB3AtSbNQ9lGgK dZSOdCVUerXe/1s5U9DYDKkmtzrTEontKxQ4dUfg= 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.1 0392/1059] Bluetooth: hci_event: Fix LE link drop on remote features command status Date: Fri, 4 Dec 2026 18:58:43 +0900 Message-ID: <20261204100654.465108735@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@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.1-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: Kept the existing nested if (conn) { if (conn->state == BT_CONFIG) ... } form with hci_conn_drop() and added the fix inside it, and dropped the hci_cs_le_read_all_remote_features() hunk because that function doesn't exist. ] 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 8e6017834bb59..4aba79ad6dd84 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -2936,6 +2936,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