From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 CE7E4431A5C; Sat, 12 Sep 2026 19:04:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789239860; cv=none; b=sDyr1HIO+PxJneNe+GiLm/GnrXRgK1a02vjl/plgOEF7X9kF5l2meINnIon5bxZvTzPDrkgE214bNNO2v5T5WdGniYwtkqGky5DWAzoEYvh2v7bQDszPL5LH/TrCv/fGLdMFA6wXFzFKS+kJ+c4LgZlJ++aDR5xrx4phkN0yooM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789239860; c=relaxed/simple; bh=l4iJatximBBZj5kS93OSNGeyIPTjfAvWbrYvAuKk2LA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aZKS6MPALFMqLhoXq66kWeRoSBlJFyJ7jgxgvLqQm9tMAB5v74aMXp+UgQDRRXLw9xxQt+T4Hl7vBshSd5PiEX+z8GS49b9sAYIJwso67cGz9LAWBd+d8OmxzuTjj3HQcgOEMFTZ7wTkHJMQUCn0K5FWxtxRxiOmkySOREBG6kM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hUX8Czhw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hUX8Czhw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACE7F1F000FF; Sat, 12 Sep 2026 19:04:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789239858; bh=JzB09jpDyuY0ivTIurZwGqBEmjq5y+BM6XEzrJn5Xvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hUX8CzhwLEr0T1tGf3yeoVTgUWxepIF7jveQFr5xF0aFzgbzOf+OSuWgXeo5VEdfS 08uB1NhF354fMg+G19fMhNOauGj9FhPbPuwVSA47DVfNNzwIzoSNEIvGjsTvtx3VII lhXTZLDCQayJxh64oMz8jvRVbw5nVFFzoODXM+ik= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zijun Hu , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 5.15 749/935] Bluetooth: btusb: Fix BD_ADDR byte order in btusb_set_bdaddr_wcn6855() Date: Sat, 12 Sep 2026 09:02:59 +0200 Message-ID: <20260912065544.011314847@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zijun Hu [ Upstream commit d0b15d812688d3f0f3fe1c4426e12814d0c294dc ] btusb_set_bdaddr_wcn6855() sends the address without swapping byte order for VSC 0xFC14, but the command expects the address in reversed byte order compared to other HCI commands like HCI_Create_Connection, resulting in a wrong BD_ADDR being set. btmon log on WCN6855 shows VSC 0xFC14 is sent with swapped bytes 11 22 33 44 55 66, and Read BD ADDR returns the expected address 11:22:33:44:55:66: < HCI Command: Vendor (0x3f|0x0014) plen 6 #3 [hci0] 11 22 33 44 55 66 > HCI Event: Command Complete (0x0e) plen 4 #4 [hci0] Vendor (0x3f|0x0014) ncmd 1 Status: Success (0x00) < HCI Command: Read BD ADDR (0x04|0x0009) plen 0 #11 [hci0] > HCI Event: Command Complete (0x0e) plen 10 #12 [hci0] Read BD ADDR (0x04|0x0009) ncmd 1 Status: Success (0x00) Address: 11:22:33:44:55:66 (OUI 11-22-33) Fix by swapping the input address before issuing the command. Fixes: b40f58b97386 ("Bluetooth: btusb: Add Qualcomm Bluetooth SoC WCN6855 support") Signed-off-by: Zijun Hu Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index f6f8ac1f4fdee..84e783f9f8752 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -3259,14 +3259,15 @@ static int btusb_set_bdaddr_ath3012(struct hci_dev *hdev, static int btusb_set_bdaddr_wcn6855(struct hci_dev *hdev, const bdaddr_t *bdaddr) { + bdaddr_t bdaddr_swapped; struct sk_buff *skb; - u8 buf[6]; long ret; - memcpy(buf, bdaddr, sizeof(bdaddr_t)); + baswap(&bdaddr_swapped, bdaddr); - skb = __hci_cmd_sync_ev(hdev, 0xfc14, sizeof(buf), buf, - HCI_EV_CMD_COMPLETE, HCI_INIT_TIMEOUT); + skb = __hci_cmd_sync_ev(hdev, 0xfc14, sizeof(bdaddr_swapped), + &bdaddr_swapped, HCI_EV_CMD_COMPLETE, + HCI_INIT_TIMEOUT); if (IS_ERR(skb)) { ret = PTR_ERR(skb); bt_dev_err(hdev, "Change address command failed (%ld)", ret); -- 2.53.0