Skip to contentSkip to conversation

Bluetooth: ISO: Release BISes left open for rebinding

PATCH In review Simon Mikuda 2 participants 2 messages Nov 22

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: ISO: Release BISes left open for rebinding

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()")
---
 net/bluetooth/iso.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
net/bluetooth/iso.c +13 -0
index 06f1e7ba2cb1..e6f0bec7b353 100644
@@ -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

Signature · 1 line
2.43.0
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/series/1218952/

---Test result---

Test Summary:

CheckPatch                    PASS      0.41 seconds
VerifyFixes                   PASS      0.05 seconds
VerifySignedoff               PASS      0.05 seconds
GitLint                       PASS      0.17 seconds
SubjectPrefix                 PASS      0.05 seconds
BuildKernel                   PASS      20.48 seconds
CheckAllWarning               PASS      23.39 seconds
CheckSparse                   PASS      24.76 seconds
BuildKernel32                 PASS      20.80 seconds
CheckKernelLLVM               PASS      22.64 seconds
TestRunnerSetup               PASS      486.48 seconds
TestRunner_iso-tester         PASS      20.18 seconds
IncrementalBuild              PASS      19.66 seconds

https://github.com/bluez/bluetooth-next/pull/1197

---
Regards,
Linux Bluetooth