Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: ISO: Release BISes left open for rebinding
@ 2026-11-22 20:13 Simon Mikuda
  2026-11-22 22:45 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Mikuda @ 2026-11-22 20:13 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Simon Mikuda, Marcel Holtmann, Luiz Augusto von Dentz

A BIS socket closed while another socket of the BIG is connected leaves its
connection in BT_OPEN for a rebind, with the hold of the socket. Only an
unbalanced parent drop used to release that hold. Now the first BIS is
never deleted, the BIG isn't terminated and removing the advertising set
fails:

    Bluetooth: hci0: Opcode 0x203c failed: -16

The next broadcast rebinds to the stale BIS and LE Create BIG fails.

Drop the holds of BISes left open when the last socket of the BIG closes.

Fixes: 4c94557dd025 ("Bluetooth: ISO: balance the parent hold in hci_bind_bis()")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/iso.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index 06f1e7ba2cb1..e6f0bec7b353 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -907,6 +907,15 @@ static void iso_sock_kill(struct sock *sk)
 	sock_put(sk);
 }
 
+static void iso_drop_open_bis(struct hci_conn *conn, void *data)
+{
+	struct hci_conn *hcon = data;
+
+	if (conn->role == HCI_ROLE_MASTER &&
+	    conn->iso_qos.bcast.big == hcon->iso_qos.bcast.big)
+		hci_conn_drop(conn);
+}
+
 static void iso_sock_disconn(struct sock *sk)
 {
 	struct sock *bis_sk;
@@ -930,6 +939,10 @@ static void iso_sock_disconn(struct sock *sk)
 			sock_put(bis_sk);
 			return;
 		}
+
+		/* Last socket of the BIG, drop the BISes left for rebinding */
+		hci_conn_hash_list_state(hcon->hdev, iso_drop_open_bis,
+					 BIS_LINK, BT_OPEN, hcon);
 	}
 
 	sk->sk_state = BT_DISCONN;

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-22 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-22 20:13 [PATCH] Bluetooth: ISO: Release BISes left open for rebinding Simon Mikuda
2026-11-22 22:45 ` bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox