diff mbox series

[BlueZ,v2,1/5] device: Attempt to elevate security on Pair while connected

Message ID 20250326193133.2718934-1-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v2,1/5] device: Attempt to elevate security on Pair while connected | expand

Commit Message

Luiz Augusto von Dentz March 26, 2025, 7:31 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

This would make Pair act behave the same as when the device reconnect
and bonding already exists.
---
 src/device.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com March 26, 2025, 8:31 p.m. UTC | #1
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=947562

---Test result---

Test Summary:
CheckPatch                    PENDING   0.24 seconds
GitLint                       PENDING   0.26 seconds
BuildEll                      PASS      20.67 seconds
BluezMake                     PASS      1547.48 seconds
MakeCheck                     FAIL      13.31 seconds
MakeDistcheck                 FAIL      144.10 seconds
CheckValgrind                 FAIL      215.07 seconds
CheckSmatch                   PASS      288.33 seconds
bluezmakeextell               PASS      100.38 seconds
IncrementalBuild              PENDING   0.31 seconds
ScanBuild                     PASS      879.29 seconds

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

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

##############################
Test: MakeCheck - FAIL
Desc: Run Bluez Make Check
Output:

./test-driver: line 107: 32282 Aborted                 (core dumped) "$@" > $log_file 2>&1
make[3]: *** [Makefile:11780: test-suite.log] Error 1
make[2]: *** [Makefile:11888: check-TESTS] Error 2
make[1]: *** [Makefile:12317: check-am] Error 2
make: *** [Makefile:12319: check] Error 2
##############################
Test: MakeDistcheck - FAIL
Desc: Run Bluez Make Distcheck
Output:

Package cups was not found in the pkg-config search path.
Perhaps you should add the directory containing `cups.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cups' found
../../test-driver: line 107: 55085 Aborted                 (core dumped) "$@" > $log_file 2>&1
make[4]: *** [Makefile:11780: test-suite.log] Error 1
make[3]: *** [Makefile:11888: check-TESTS] Error 2
make[2]: *** [Makefile:12317: check-am] Error 2
make[1]: *** [Makefile:12319: check] Error 2
make: *** [Makefile:12240: distcheck] Error 1
##############################
Test: CheckValgrind - FAIL
Desc: Run Bluez Make Check with Valgrind
Output:

tools/mgmt-tester.c: In function ‘main’:
tools/mgmt-tester.c:12907:5: note: variable tracking size limit exceeded with ‘-fvar-tracking-assignments’, retrying without
12907 | int main(int argc, char *argv[])
      |     ^~~~
./test-driver: line 107: 75123 Aborted                 (core dumped) "$@" > $log_file 2>&1
make[3]: *** [Makefile:11780: test-suite.log] Error 1
make[2]: *** [Makefile:11888: check-TESTS] Error 2
make[1]: *** [Makefile:12317: check-am] Error 2
make: *** [Makefile:12319: check] Error 2
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth
patchwork-bot+bluetooth@kernel.org March 27, 2025, 4:10 p.m. UTC | #2
Hello:

This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 26 Mar 2025 15:31:29 -0400 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> This would make Pair act behave the same as when the device reconnect
> and bonding already exists.
> ---
>  src/device.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Here is the summary with links:
  - [BlueZ,v2,1/5] device: Attempt to elevate security on Pair while connected
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=8e2cece67dbe
  - [BlueZ,v2,2/5] device: Make Connect and Pair mutually exclusive
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1c2ec29900e4
  - [BlueZ,v2,3/5] device: Use btd_device_is_initiator instead of Connect message
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=45b61a10bd0a
  - [BlueZ,v2,4/5] shared/att: Make bt_att_set_security never downgrade security level
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ac1f8dd88a46
  - [BlueZ,v2,5/5] device: Elevate bt_att security if bonding is in progress
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=5df9521ce4d5

You are awesome, thank you!
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 9774b5bf1b96..f76c1ec3eabf 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3194,10 +3194,13 @@  static DBusMessage *pair_device(DBusConnection *conn, DBusMessage *msg,
 
 		if (!state->connected && btd_le_connect_before_pairing())
 			err = device_connect_le(device);
-		else
+		else if (!state->connected || !bt_att_set_security(device->att,
+						BT_ATT_SECURITY_MEDIUM))
 			err = adapter_create_bonding(adapter, &device->bdaddr,
 							device->bdaddr_type,
 							io_cap);
+		else
+			err = 0;
 	} else {
 		err = adapter_create_bonding(adapter, &device->bdaddr,
 							BDADDR_BREDR, io_cap);