Skip to contentSkip to conversation

a2dp: Fix not detecting transport connection collision

PATCH Applied Luiz Augusto von Dentz 3 participants 3 messages Sep 16, 2022 – Sep 19, 2022 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 a2dp: Fix not detecting transport connection collision

From: Luiz Augusto von Dentz <[email protected]>

Some headsets appears to attempt to connect back after receiving AVDTP_Open which would cause unexpected transitions since setup->io and stream->io would not be in sync:

Quoted 1 line

ACL Data RX: Handle 70 flags 0x02 dlen 6

      Channel: 64 len 2 [PSM 25 mode Basic (0x00)] {chan 0}
      AVDTP: Open (0x06) Response Accept (0x02) type 0x00 label 2 nosp 0
< ACL Data TX: Handle 70 flags 0x00 dlen 12
      L2CAP: Connection Request (0x02) ident 6 len 4
        PSM: 25 (0x0019)
        Source CID: 67
Quoted 1 line

ACL Data RX: Handle 70 flags 0x02 dlen 12

      L2CAP: Connection Request (0x02) ident 10 len 4
        PSM: 25 (0x0019)
        Source CID: 68
< ACL Data TX: Handle 70 flags 0x00 dlen 16
      L2CAP: Connection Response (0x03) ident 10 len 8
        Destination CID: 68
        Source CID: 68
        Result: Connection pending (0x0001)
        Status: Authorization pending (0x0002)
< ACL Data TX: Handle 70 flags 0x00 dlen 16
      L2CAP: Connection Response (0x03) ident 10 len 8
        Destination CID: 68
        Source CID: 68
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
Quoted 1 line

ACL Data RX: Handle 70 flags 0x02 dlen 16

      L2CAP: Connection Response (0x03) ident 6 len 8
        Destination CID: 69
        Source CID: 67
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
---
 profiles/audio/a2dp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
profiles/audio/a2dp.c +2 -1
index 276512208e13..47b5dd7c3d25 100644
@@ -2522,7 +2522,8 @@ static void confirm_cb(GIOChannel *io, gpointer data)
 		if (!setup || !setup->stream)
 			goto drop;
 
-		if (setup->io) {
+		if (setup->io || avdtp_stream_get_transport(setup->stream,
+						NULL, NULL, NULL, NULL)) {
 			error("transport channel already exists");
 			goto drop;
 		}
Signature · 1 line
2.37.3
#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/project/bluetooth/list/?series=677765

---Test result---

Test Summary:

CheckPatch                    PASS      1.38 seconds
GitLint                       PASS      0.98 seconds
Prep - Setup ELL              PASS      26.86 seconds
Build - Prep                  PASS      0.80 seconds
Build - Configure             PASS      8.74 seconds
Build - Make                  PASS      845.32 seconds
Make Check                    PASS      12.12 seconds
Make Check w/Valgrind         PASS      290.25 seconds
Make Distcheck                PASS      236.74 seconds
Build w/ext ELL - Configure   PASS      8.59 seconds
Build w/ext ELL - Make        PASS      83.52 seconds
Incremental Build w/ patches  PASS      0.00 seconds
Scan Build                    PASS      515.16 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Luiz Augusto von Dentz
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 29 lines · On Fri, 16 Sep 2022 14:42:35 -0700 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

Some headsets appears to attempt to connect back after receiving AVDTP_Open which would cause unexpected transitions since setup->io and stream->io would not be in sync:

Quoted 1 line

ACL Data RX: Handle 70 flags 0x02 dlen 6

      Channel: 64 len 2 [PSM 25 mode Basic (0x00)] {chan 0}
      AVDTP: Open (0x06) Response Accept (0x02) type 0x00 label 2 nosp 0
< ACL Data TX: Handle 70 flags 0x00 dlen 12
      L2CAP: Connection Request (0x02) ident 6 len 4
        PSM: 25 (0x0019)
        Source CID: 67
Quoted 1 line

ACL Data RX: Handle 70 flags 0x02 dlen 12

      L2CAP: Connection Request (0x02) ident 10 len 4
        PSM: 25 (0x0019)
        Source CID: 68
< ACL Data TX: Handle 70 flags 0x00 dlen 16
      L2CAP: Connection Response (0x03) ident 10 len 8
        Destination CID: 68
        Source CID: 68
        Result: Connection pending (0x0001)
        Status: Authorization pending (0x0002)
< ACL Data TX: Handle 70 flags 0x00 dlen 16
      L2CAP: Connection Response (0x03) ident 10 len 8
        Destination CID: 68
        Source CID: 68
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)
Quoted 8 lines
Quoted 1 line

ACL Data RX: Handle 70 flags 0x02 dlen 16

      L2CAP: Connection Response (0x03) ident 6 len 8
        Destination CID: 69
        Source CID: 67
        Result: Connection successful (0x0000)
        Status: No further information available (0x0000)

[...]

Here is the summary with links:
- [BlueZ] a2dp: Fix not detecting transport connection collision

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=b7023510c929

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html