]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: ISO: clear iso_data always when detaching conn from hcon
authorPauli Virtanen <pav@iki.fi>
Mon, 20 Jul 2026 14:53:33 +0000 (17:53 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 28 Jul 2026 18:45:34 +0000 (14:45 -0400)
When setting conn->hcon = NULL, also conn->hcon->iso_data = NULL is
necessary, otherwise later iso_conn_free() will UAF.

Fix clearing of iso_data in iso_sock_disconn()

Fixes KASAN: slab-use-after-free in iso_conn_hold_unless_zero on
iso_sock_release() followed by hci_abort_conn_sync().

Fixes: fbdc4bc47268 ("Bluetooth: ISO: Use defer setup to separate PA sync and BIG sync")
Signed-off-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/iso.c

index 2e95a153912c5de477d747fe0188b39f05f7a538..babba61eb33541f33ea280cee00f50f2e2ef0c7b 100644 (file)
@@ -837,6 +837,7 @@ static void iso_sock_disconn(struct sock *sk)
        sk->sk_state = BT_DISCONN;
        iso_conn_lock(iso_pi(sk)->conn);
        hci_conn_drop(iso_pi(sk)->conn->hcon);
+       iso_pi(sk)->conn->hcon->iso_data = NULL;
        iso_pi(sk)->conn->hcon = NULL;
        iso_conn_unlock(iso_pi(sk)->conn);
 }