Skip to contentSkip to conversation

gobex: Fix abort for SRM operation

PATCH Applied Frédéric Danis 4 participants 6 messages Oct 9, 2025 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gobex: Fix abort for SRM operation

The OBEX Abort operation currently triggers an OBEX session which prevents further OBEX operations:

obexd[327475]: obexd/client/transfer.c:obc_transfer_register()

               0x50e000001380 registered
               /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=4
obexd[327475]: obexd/client/session.c:session_process_transfer()
               Transfer(0x50e000001380) started
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=3
obexd[327475]: Transfer(0x50e000001380) Error: Transfer cancelled by user
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=4
obexd[327475]: obexd/client/transfer.c:obc_transfer_unregister()
               0x50e000001380 unregistered
               /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/transfer.c:obc_transfer_free() 0x50e000001380
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=2
obexd[327475]: Unknown header offset for opcode 0x10
obexd[327475]: obexd/client/session.c:obc_session_shutdown()
               0x50c0000010c0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/pbap.c:pbap_remove()
               /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=2
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=1
obexd[327475]: obexd/client/session.c:session_unregistered()
               Session(0x50c0000010c0) unregistered
               /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=0

As its highest bit is always set to 1, and so its value located after G_OBEX_RSP_CONTINUE, the G_OBEX_OP_ABORT is part of the operations constants.

This has been tested for PBAP and BIP-AVRCP with Android 15 and 16.

---
 gobex/gobex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gobex/gobex.c +1 -1
index 0e33ececf..df80d79f3 100644
@@ -382,7 +382,7 @@ static void check_srm_final(GObex *obex, guint8 op)
 	case G_OBEX_OP_CONNECT:
 		return;
 	default:
-		if (op <= G_OBEX_RSP_CONTINUE)
+		if (op <= G_OBEX_RSP_CONTINUE || op == G_OBEX_OP_ABORT)
 			return;
 	}
 
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/project/bluetooth/list/?series=1009611

---Test result---

Test Summary:

CheckPatch                    PENDING   0.29 seconds
GitLint                       PENDING   0.30 seconds
BuildEll                      PASS      18.02 seconds
BluezMake                     PASS      4218.86 seconds
MakeCheck                     PASS      19.77 seconds
MakeDistcheck                 PASS      173.56 seconds
CheckValgrind                 PASS      229.21 seconds
CheckSmatch                   PASS      270.76 seconds
bluezmakeextell               PASS      123.13 seconds
IncrementalBuild              PENDING   0.38 seconds
ScanBuild                     PASS      838.78 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Frédéric Danis

Hi Frederic,

Quoted 57 lines · Frédéric Danis

The OBEX Abort operation currently triggers an OBEX session which prevents further OBEX operations:

obexd[327475]: obexd/client/transfer.c:obc_transfer_register()

               0x50e000001380 registered
               /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=4
obexd[327475]: obexd/client/session.c:session_process_transfer()
               Transfer(0x50e000001380) started
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=3
obexd[327475]: Transfer(0x50e000001380) Error: Transfer cancelled by user
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=4
obexd[327475]: obexd/client/transfer.c:obc_transfer_unregister()
               0x50e000001380 unregistered
               /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/transfer.c:obc_transfer_free() 0x50e000001380
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=2
obexd[327475]: Unknown header offset for opcode 0x10
obexd[327475]: obexd/client/session.c:obc_session_shutdown()
               0x50c0000010c0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/pbap.c:pbap_remove()
               /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=2
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=1
obexd[327475]: obexd/client/session.c:session_unregistered()
               Session(0x50c0000010c0) unregistered
               /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=0

As its highest bit is always set to 1, and so its value located after G_OBEX_RSP_CONTINUE, the G_OBEX_OP_ABORT is part of the operations constants.

This has been tested for PBAP and BIP-AVRCP with Android 15 and 16.

---
 gobex/gobex.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
gobex/gobex.c +0 -0
index 0e33ececf..df80d79f3 100644

gobex/gobex.c static void check_srm_final(GObex *obex, guint8 op) · line 385

Quoted 5 lines
gobex/gobex.c +1 -1
@@ -382,7 +382,7 @@ static void check_srm_final(GObex *obex, guint8 op)
        case G_OBEX_OP_CONNECT:
                return;
        default:
-               if (op <= G_OBEX_RSP_CONTINUE)
+               if (op <= G_OBEX_RSP_CONTINUE || op == G_OBEX_OP_ABORT)

Let's move it to a case statement as it was done with G_OBEX_OP_CONNECT.

Quoted 7 lines
gobex/gobex.c +0 -1
                        return;
        }
 
--

2.43.0

Signature · 1 line
Luiz Augusto von Dentz
#3 lore raw

Hi Luiz,

Quoted 55 lines · Luiz Augusto von Dentz

Hi Frederic,

Quoted 51 lines · Frédéric Danis

The OBEX Abort operation currently triggers an OBEX session which prevents further OBEX operations:

obexd[327475]: obexd/client/transfer.c:obc_transfer_register()

                0x50e000001380 registered
                /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=3
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=4
obexd[327475]: obexd/client/session.c:session_process_transfer()
                Transfer(0x50e000001380) started
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=3
obexd[327475]: Transfer(0x50e000001380) Error: Transfer cancelled by user
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=4
obexd[327475]: obexd/client/transfer.c:obc_transfer_unregister()
                0x50e000001380 unregistered
                /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/transfer.c:obc_transfer_free() 0x50e000001380
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=3
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=2
obexd[327475]: Unknown header offset for opcode 0x10
obexd[327475]: obexd/client/session.c:obc_session_shutdown()
                0x50c0000010c0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=3
obexd[327475]: obexd/client/pbap.c:pbap_remove()
                /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=2
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=1
obexd[327475]: obexd/client/session.c:session_unregistered()
                Session(0x50c0000010c0) unregistered
                /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=0

As its highest bit is always set to 1, and so its value located after G_OBEX_RSP_CONTINUE, the G_OBEX_OP_ABORT is part of the operations constants.

This has been tested for PBAP and BIP-AVRCP with Android 15 and 16.

---
  gobex/gobex.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

gobex/gobex.c static void check_srm_final(GObex *obex, guint8 op) · line 385

Quoted 10 lines
gobex/gobex.c +1 -1
index 0e33ececf..df80d79f3 100644
@@ -382,7 +382,7 @@ static void check_srm_final(GObex *obex, guint8 op)
         case G_OBEX_OP_CONNECT:
                 return;
         default:
-               if (op <= G_OBEX_RSP_CONTINUE)
+               if (op <= G_OBEX_RSP_CONTINUE || op == G_OBEX_OP_ABORT)

Let's move it to a case statement as it was done with G_OBEX_OP_CONNECT.

The case for G_OBEX_OP_CONNECT is switched from obex->srm->op, while the test for G_OBEX_OP_ABORT is done on the op function parameter. I don't think it's useful to create a switch here.

Quoted 9 lines
Quoted 8 lines
gobex/gobex.c +0 -1
                         return;
         }
 
--

2.43.0

Signature · 6 lines
Frédéric Danis
Senior Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, United Kingdom
Registered in England & Wales, no. 5513718
#4 lore raw

Hi Frederic,

Quoted 70 lines · Frédéric Danis

Hi Luiz,

Quoted 55 lines · Luiz Augusto von Dentz

Hi Frederic,

Quoted 51 lines · Frédéric Danis

The OBEX Abort operation currently triggers an OBEX session which prevents further OBEX operations:

obexd[327475]: obexd/client/transfer.c:obc_transfer_register()

                0x50e000001380 registered
                /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=3
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=4
obexd[327475]: obexd/client/session.c:session_process_transfer()
                Transfer(0x50e000001380) started
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=3
obexd[327475]: Transfer(0x50e000001380) Error: Transfer cancelled by user
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=4
obexd[327475]: obexd/client/transfer.c:obc_transfer_unregister()
                0x50e000001380 unregistered
                /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/transfer.c:obc_transfer_free() 0x50e000001380
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=3
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=2
obexd[327475]: Unknown header offset for opcode 0x10
obexd[327475]: obexd/client/session.c:obc_session_shutdown()
                0x50c0000010c0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
                ref=3
obexd[327475]: obexd/client/pbap.c:pbap_remove()
                /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=2
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=1
obexd[327475]: obexd/client/session.c:session_unregistered()
                Session(0x50c0000010c0) unregistered
                /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
                ref=0

As its highest bit is always set to 1, and so its value located after G_OBEX_RSP_CONTINUE, the G_OBEX_OP_ABORT is part of the operations constants.

This has been tested for PBAP and BIP-AVRCP with Android 15 and 16.

---
  gobex/gobex.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

gobex/gobex.c static void check_srm_final(GObex *obex, guint8 op) · line 385

Quoted 10 lines
gobex/gobex.c +1 -1
index 0e33ececf..df80d79f3 100644
@@ -382,7 +382,7 @@ static void check_srm_final(GObex *obex, guint8 op)
         case G_OBEX_OP_CONNECT:
                 return;
         default:
-               if (op <= G_OBEX_RSP_CONTINUE)
+               if (op <= G_OBEX_RSP_CONTINUE || op == G_OBEX_OP_ABORT)

Let's move it to a case statement as it was done with G_OBEX_OP_CONNECT.

Quoted 3 lines

The case for G_OBEX_OP_CONNECT is switched from obex->srm->op, while the test for G_OBEX_OP_ABORT is done on the op function parameter. I don't think it's useful to create a switch here.

My bad, I didn't pay attention to what opcode it was tested in the switch statement.

Quoted 18 lines
Quoted 9 lines
Quoted 8 lines
gobex/gobex.c +0 -1
                         return;
         }
 
--

2.43.0

--
Frédéric Danis
Senior Software Engineer

Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, United Kingdom Registered in England & Wales, no. 5513718

Signature · 1 line
Luiz Augusto von Dentz
#5 lore raw
In reply to Frédéric Danis
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 42 lines · On Thu, 9 Oct 2025 09:11:59 +0200 you wrote:

The OBEX Abort operation currently triggers an OBEX session which prevents further OBEX operations:

obexd[327475]: obexd/client/transfer.c:obc_transfer_register()

               0x50e000001380 registered
               /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=4
obexd[327475]: obexd/client/session.c:session_process_transfer()
               Transfer(0x50e000001380) started
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=3
obexd[327475]: Transfer(0x50e000001380) Error: Transfer cancelled by user
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=4
obexd[327475]: obexd/client/transfer.c:obc_transfer_unregister()
               0x50e000001380 unregistered
               /org/bluez/obex/client/session0/transfer0
obexd[327475]: obexd/client/transfer.c:obc_transfer_free() 0x50e000001380
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=2
obexd[327475]: Unknown header offset for opcode 0x10
obexd[327475]: obexd/client/session.c:obc_session_shutdown()
               0x50c0000010c0
obexd[327475]: obexd/client/session.c:obc_session_ref() 0x50c0000010c0:
               ref=3
obexd[327475]: obexd/client/pbap.c:pbap_remove()
               /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=2
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=1
obexd[327475]: obexd/client/session.c:session_unregistered()
               Session(0x50c0000010c0) unregistered
               /org/bluez/obex/client/session0
obexd[327475]: obexd/client/session.c:obc_session_unref() 0x50c0000010c0:
               ref=0
Quoted 1 line

[...]

Here is the summary with links:
- [BlueZ] gobex: Fix abort for SRM operation

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

You are awesome, thank you!

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