]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: ISO: Fix another instance of dst_type handling
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 7 Oct 2025 17:29:15 +0000 (13:29 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:33:58 +0000 (15:33 -0500)
[ Upstream commit c403da5e98b04a2aec9cfb25cbeeb28d7ce29975 ]

Socket dst_type cannot be directly assigned to hci_conn->type since
there domain is different which may lead to the wrong address type being
used.

Fixes: 6a5ad251b7cd ("Bluetooth: ISO: Fix possible circular locking dependency")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/iso.c

index c9a262f97678bd1c530341f8d1850533d90d5f1e..a48a2868a728bed7a9786f0c3f7ff6ad4d0a009f 100644 (file)
@@ -1939,7 +1939,13 @@ static void iso_conn_ready(struct iso_conn *conn)
                }
 
                bacpy(&iso_pi(sk)->dst, &hcon->dst);
-               iso_pi(sk)->dst_type = hcon->dst_type;
+
+               /* Convert from HCI to three-value type */
+               if (hcon->dst_type == ADDR_LE_DEV_PUBLIC)
+                       iso_pi(sk)->dst_type = BDADDR_LE_PUBLIC;
+               else
+                       iso_pi(sk)->dst_type = BDADDR_LE_RANDOM;
+
                iso_pi(sk)->sync_handle = iso_pi(parent)->sync_handle;
                memcpy(iso_pi(sk)->base, iso_pi(parent)->base, iso_pi(parent)->base_len);
                iso_pi(sk)->base_len = iso_pi(parent)->base_len;