2023-06-07 08:25:32

by Iulia Tanasescu

[permalink] [raw]
Subject: [PATCH 0/1] Bluetooth: ISO: cleanup bound BISes

This patch fixes the fact that if a broadcast socket is closed
while it is still in BT_CONNECT state (that is before the BIG
was successfully created), the connection will not be properly
cleaned up - the bis_cleanup callback will not be called.

If the socket is closed, even if the BIG was not yet created,
the advertising set should still be terminated, and the conn
should be removed from the hash list, so that when the
BIG complete event arrives, no active connections will be
found and the BIG will be terminated also.

Iulia Tanasescu (1):
Bluetooth: ISO: cleanup bound BISes

net/bluetooth/iso.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)


base-commit: 817efd3cad7481ce2ee25fac5108afecbad56228
--
2.34.1



2023-06-07 08:26:08

by Iulia Tanasescu

[permalink] [raw]
Subject: [PATCH 1/1] Bluetooth: ISO: cleanup bound BISes

For some broadcast scenarios, the user might open a nonblocking socket
and might call connect without defer setup - this will queue the
commands for adding an advertising instance and creating a BIG.

If the socket is closed before the LE BIG Complete event arrives
(connection is still pending), the conn should be properly cleaned up:
it should be removed from the hash list, the adv set should be removed,
and the BIG will be terminated once the LE BIG Complete event arrives,
since no active connections will be found at that point.

Signed-off-by: Iulia Tanasescu <[email protected]>
---
net/bluetooth/iso.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/net/bluetooth/iso.c b/net/bluetooth/iso.c
index b9a008fd10b1..261e26ec8f16 100644
--- a/net/bluetooth/iso.c
+++ b/net/bluetooth/iso.c
@@ -655,13 +655,15 @@ static void __iso_sock_close(struct sock *sk)
iso_conn_defer_reject(iso_pi(sk)->conn->hcon);
iso_chan_del(sk, ECONNRESET);
break;
+
case BT_CONNECT:
- /* In case of DEFER_SETUP the hcon would be bound to CIG which
- * needs to be removed so just call hci_conn_del so the cleanup
- * callback do what is needed.
+ /* In case hcon is bound to a CIG/BIG, just call
+ * hci_conn_del so the cleanup callback does what
+ * is needed.
*/
- if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags) &&
- iso_pi(sk)->conn->hcon) {
+ if ((!bacmp(&iso_pi(sk)->dst, BDADDR_ANY) ||
+ test_bit(BT_SK_DEFER_SETUP, &bt_sk(sk)->flags)) &&
+ iso_pi(sk)->conn->hcon) {
hci_conn_del(iso_pi(sk)->conn->hcon);
iso_pi(sk)->conn->hcon = NULL;
}
--
2.34.1


2023-06-07 09:01:34

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: ISO: cleanup bound BISes

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/project/bluetooth/list/?series=754765

---Test result---

Test Summary:
CheckPatch PASS 0.71 seconds
GitLint PASS 0.35 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 33.93 seconds
CheckAllWarning PASS 37.72 seconds
CheckSparse PASS 42.03 seconds
CheckSmatch PASS 115.65 seconds
BuildKernel32 PASS 32.34 seconds
TestRunnerSetup PASS 443.80 seconds
TestRunner_l2cap-tester PASS 16.49 seconds
TestRunner_iso-tester PASS 22.45 seconds
TestRunner_bnep-tester PASS 5.39 seconds
TestRunner_mgmt-tester PASS 110.42 seconds
TestRunner_rfcomm-tester PASS 8.62 seconds
TestRunner_sco-tester PASS 7.92 seconds
TestRunner_ioctl-tester PASS 9.15 seconds
TestRunner_mesh-tester PASS 6.80 seconds
TestRunner_smp-tester PASS 7.84 seconds
TestRunner_userchan-tester PASS 5.67 seconds
IncrementalBuild PASS 29.24 seconds



---
Regards,
Linux Bluetooth