Commits

Commit Message Author Age Changes
db790b7d doc/l2cap: Fix BT_POWER default Default is actually BT_POWER_FORCE_ACTIVE_ON as the kernel code net/bluetooth/l2cap_core.c:l2cap_chan_set_defaults do: set_bit(FLAG_FORCE_ACTIVE, &chan->flags); Luiz Augusto von Dentz 8 months ago 1 file, +2, -2
9c52188d input: fix HoG compilation w/o HID Commit [1] introduced a dependency with the HID plugin in the HoG code As a result, building with --disable-hid --enable-hog caused linker errors due to undefined references to HID-related functions: ``` > ./configure --disable-hid --enable-hog > make /usr/bin/ld: profiles/input/bluetoothd-hog.o: in function `hog_accept': /home/../bluez/profiles/input/hog.c:184:(.text.hog_accept+0xbb): undefined reference to `input_get_auto_sec' /usr/bin/ld: profiles/input/bluetoothd-hog.o: in function `hog_disconnect': /home/../bluez/profiles/input/hog.c:205:(.text.hog_disconnect+0x12): undefined reference to `input_get_userspace_hid' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:6344: src/bluetoothd] Error 1 make: *** [Makefile:4695: all] Error 2 ``` This patch duplicate the read of the 'UserspaceHID=persist' config entry in the HoG plugin file to remove the dependency on the HID plugin files. [1] 1782bfd79 input: Add support for UserspaceHID=persist Fixes: https://github.com/bluez/bluez/issues/1228 Thomas Perale 8 months ago 3 files, +12, -8
b111b5e1 input: fix HID compilation w/o HoG Commit [1] introduced a dependency with the HID plugin in the HoG code As a result, building with --enable-hid --disable-hog caused linker errors due to undefined references to HoG-related functions: ``` > ./configure --enable-hid --disable-hog ... > make ... CCLD src/bluetoothd /usr/bin/ld: profiles/input/bluetoothd-manager.o: in function `input_init': /home/../bluez/profiles/input/manager.c:122:(.text.input_init+0x1c8): undefined reference to `input_set_auto_sec' collect2: error: ld returned 1 exit status make[1]: *** [Makefile:6376: src/bluetoothd] Error 1 ``` This patch moves the reading of the HOG specific configuration of the 'input.conf' file: LEAutoSecurity, to the HoG plugin file. [1] f2778f587 input: Add LEAutoSecurity setting to input.conf Thomas Perale 8 months ago 3 files, +36, -16
bbfeef3a shell: Clarify "mode" variable It's unclear what that variable did, and which value corresponded to which state, so replace it with a typed enum so that conditionals are more easily parsed. Bastien Nocera 8 months ago 1 file, +20, -14
f8d0dc11 Revert "obexd: only run one instance at once" No longer needed now services can share resources. This reverts commit 8d472b8758dcdd89bf13cf2fb06a8846e1f483a0. Andrew Sayers 8 months ago 1 file, +0, -9
8b29b5a4 obexd: Support sd_login_monitor_get_timeout() The documentation for sd_login_monitor_get_timeout() implies the API may need to be checked after some time, even if no events have been received via the fd. In practice, the implementation has always returned a dummy value, and changing it now would cause enough breakage in other projects to make it unlikely to ever happen. Add a handler for that case, even though it can't currently happen in the real world. The API assumes we call poll() directly, so in theory it could change the timeout based on some event that doesn't trigger a callback (e.g. sending a signal to the service). It's hard to see how we'd handle that without running a poll() in a separate thread, which would be a lot of complexity for an untestable edge case. Don't try to handle that problem. Andrew Sayers 8 months ago 1 file, +43, -0
765356e8 obexd: Unregister profiles when the user is inactive Obexd is usually run as a user service, and can exhibit surprising behaviour if two users are logged in at the same time. Unregister profiles when the user is detected to be off-seat. It may be impossible to detect whether a user is on-seat in some cases. For example, a version of obexd compiled with systemd support might be run outside of a systemd environment. Warn and leave services registered if that happens. Obexd can be run as a system service, in which case this check makes no sense. Disable this check when called with `--system-bus`. Obexd can also be run by a user that does not have an active session. For example, someone could use `ssh` to access the system. There might be a use case where someone needs Bluetooth access but can't log in with a keyboard, or there might be a security issue with doing so. This isn't handled explicitly by this patch, but a future patch could add support by calling `logind_set(FALSE)` in the same way as is currently done with `--system-bus`. Unregister profiles by closing private connections instead of sending UnregisterProfile on the shared connection. Pipewire has apparently found the latter to cause long shutdown delays, because bluetoothd may be shutting down and unable to handle this message. Based in large part on the wireplumber code mentioned by Pauli Virtanen: https://gitlab.freedesktop.org/pipewire/wireplumber/-/blob/master/modules/module-logind.c#L52 Other services are likely to need similar functionality, so I have created a gist to demonstrate the basic technique: https://gist.github.com/andrew-sayers/1c4a24f86a9a4c1b1e38d109f1bd1d1e Suggested-by: Pauli Virtanen <pav@iki.fi> Andrew Sayers 8 months ago 6 files, +316, -5
5b6c096f workflows: Add codacy action Luiz Augusto von Dentz 8 months ago 1 file, +61, -0
570a5505 device: Fix not setting DEVICE_FLAG_REMOTE_WAKEUP when required Due to the introduction of DEVICE_FLAG_ADDRESS_RESOLUTION it is no longer possible to check if the kernel has support for it ahead of time since that would depend on device->supported_flags which is only updated with MGMT_OP_ADD_DEVICE _after_ services are probed. Fixes: https://github.com/bluez/bluez/issues/1207 Luiz Augusto von Dentz 8 months ago 1 file, +0, -6
237d818e obexd: Support creating private system/session bus connections Obexd can either connect to the system or session bus. We mostly share a common connection to that bus, but it can be useful to have a private connection. For example, this allows us to quickly unregister profiles when switching user. Add obex_setup_dbus_connection_private(), which creates a new connection to whichever bus was specified by the user. Andrew Sayers 8 months ago 2 files, +10, -0
29f3c07b obexd/bluetooth: Support calling bluetooth_init() after bluetooth_exit() bluetooth_exit() didn't previously unregister itself thoroughly. That was fine if it was only called when the service was about to exit, because everything was implicitly unregistered when the process ended. But we need to be more scrupulous if this can be called throughout the program's lifecycle. Send UnregisterProfile messages directly from bluetooth_exit(), then call unregister_profile(profile). The UnregisterProfile message can't be sent directly from unregister_profile(), because that also needs to be called when register_profile() fails halfway through. Do not free profiles in bluetooth_exit() - profiles are needed by a future call to bluetooth_init(), or will be freed by bluetooth_stop() if necessary. Andrew Sayers 8 months ago 1 file, +14, -2
9bf6bb65 pbap: Support calling pbap_init() after pbap_exit() pbap_exit() didn't previously unregister itself thoroughly. That was fine if it was only called when the service was about to exit, because everything was implicitly unregistered when the process ended. But we need to be more scrupulous if this can be called throughout the program's lifecycle. Send the UnregisterProfile message directly from pbap_exit(), then call unregister_profile(). The UnregisterProfile message can't be sent directly from unregister_profile(), because that also needs to be called when register_profile() fails halfway through. Andrew Sayers 8 months ago 1 file, +14, -2
f96f3b34 shared/bap: Too few arguments to formatting function Each call to the printf function, or a related function, should include the number of arguments defined by the format. Passing the function more arguments than required is harmless (although it may be indicative of other defects). However, passing the function fewer arguments than are defined by the format can be a security vulnerability since the function will process the next item on the stack as the missing arguments. Fixes: https://github.com/bluez/bluez/issues/1221 Fixes: https://github.com/bluez/bluez/issues/1222 Luiz Augusto von Dentz 8 months ago 1 file, +3, -2
51adc109 client/mgmt: Fix potentially overflowing call to snprintf The return value of a call to snprintf is the number of characters that would have been written to the buffer assuming there was sufficient space. In the event that the operation reaches the end of the buffer and more than one character is discarded, the return value will be greater than the buffer size. Fixes: https://github.com/bluez/bluez/issues/1216 Fixes: https://github.com/bluez/bluez/issues/1217 Fixes: https://github.com/bluez/bluez/issues/1218 Fixes: https://github.com/bluez/bluez/issues/1219 Luiz Augusto von Dentz 8 months ago 1 file, +40, -8
e18ce6c9 test-runner: Fix potentially overflowing call to snprintf The return value of a call to snprintf is the number of characters that would have been written to the buffer assuming there was sufficient space. In the event that the operation reaches the end of the buffer and more than one character is discarded, the return value will be greater than the buffer size. Fixes: https://github.com/bluez/bluez/issues/1215 Luiz Augusto von Dentz 8 months ago 1 file, +9, -1
25c23ffc client/mgmt: Fix comparison of narrow type with wide type in loop condition In a loop condition, comparison of a value of a narrow type with a value of a wide type may result in unexpected behavior if the wider value is sufficiently large (or small). Fixes: https://github.com/bluez/bluez/issues/1211 Luiz Augusto von Dentz 8 months ago 1 file, +2, -2
295ec994 main: Fix comparison of narrow type with wide type in loop condition In a loop condition, comparison of a value of a narrow type with a value of a wide type may result in unexpected behavior if the wider value is sufficiently large (or small). Fixes: https://github.com/bluez/bluez/issues/1213 Luiz Augusto von Dentz 8 months ago 1 file, +1, -1
9a4c0385 tools: add tests for SIOCETHTOOL ETHTOOL_GET_TS_INFO Add tests for obtaining timestamping capabilities via ethtool ioctl: L2CAP BR/EDR Ethtool Get Ts Info - Success L2CAP LE Ethtool Get Ts Info - Success SCO Ethtool Get Ts Info - Success SCO Ethtool Get Ts Info No Flowctl - Success ISO Ethtool Get Ts Info - Success Pauli Virtanen 8 months ago 4 files, +90, -1
2cfc3521 hciemu: fix accessing wrong/uninitialized variables Fixes: aeeb4fd64adf ("hciemu: set bthost ACL MTU to match btdev") Fixes: a112d4345771 ("bthost: implement fragmenting to ACL MTU") Pauli Virtanen 8 months ago 2 files, +2, -2
f1d16721 sco-tester: add SCO receive and RX timestamping tests Add tests: SCO CVSD Recv - Success SCO CVSD Recv - RX Timestamping Pauli Virtanen 8 months ago 1 file, +83, -1
682e9252 bthost: support sending SCO packets Add function to send SCO packets via bthost. Pauli Virtanen 8 months ago 2 files, +34, -0
aeeb4fd6 hciemu: set bthost ACL MTU to match btdev Set the bthost ACL MTU to avoid generating larger packets than the btdev ACL MTU. This tests RX timestamping on ACL fragmentation. Pauli Virtanen 8 months ago 3 files, +18, -0
a112d434 bthost: implement fragmenting to ACL MTU Support fragmenting ACL packets to given ACL MTU. Pauli Virtanen 8 months ago 2 files, +79, -15
7763584f tools: add tests for RX timestamping Add tests: ISO Receive - RX Timestamping L2CAP BR/EDR Client - RX Timestamping L2CAP BR/EDR Client - RX Timestamping 32k L2CAP LE Client - RX Timestamping L2CAP LE Client - RX Timestamping 32k Pauli Virtanen 8 months ago 3 files, +160, -2
1be17107 shared/ad: Fix crash on match_manufacturer When matching manufacturer BT_EA_MAX_DATA_LEN in case of EA since that can be bigger than regular advertisements otherwise it can cause the following crash: data #0 __libc_do_syscall () at ../sysdeps/unix/sysv/linux/arm/libc-do-syscall.S:47 1 0xb6e05c58 in __pthread_kill_implementation (threadid=, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:43 2 0xb6e05c8c in __pthread_kill_internal (signo=6, threadid=) at pthread_kill.c:78 3 0xb6dd63ce in __GI_raise (sig=sig@entry=6) at /usr/src/debug/glibc/2.39+git/sysdeps/posix/raise.c:26 4 0xb6dc7f5c in __GI_abort () at abort.c:79 5 0xb6dfd608 in __libc_message_impl (fmt=0xb6ea1a50 "*** %s **: terminated\n") at /usr/src/debug/glibc/2.39+git/sysdeps/posix/libc_fatal.c:134 6 0xb6e5a430 in __GI___fortify_fail (msg=) at fortify_fail.c:24 7 0xb6e59ffe in __GI___chk_fail () at chk_fail.c:28 8 0xb6e5a8a2 in __GI___memcpy_chk (dstpp=dstpp@entry=0xbefff7e6, srcpp=, len=, dstlen=dstlen@entry=29) at memcpy_chk.c:27 9 0x004944f4 in memcpy (__len=, __src=, __dest=0xbefff7e6) at /usr/include/bits/string_fortified.h:29 10 match_manufacturer (data=, user_data=) Fixes: https://github.com/bluez/bluez/issues/1169 Luiz Augusto von Dentz 8 months ago 1 file, +1, -1
c3b6f4e4 device: Check presence of ServiceRecords when loading from store For a HID paired device, if the cache file containing the SDP records is not present this will prevent the device to connect and need to remove it and pair again. Current bluetoothd traces: src/shared/mgmt.c:can_read_data() [0x0000] event 0x000b src/adapter.c:connected_callback() hci0 device EC:83:50:76:BD:67 connected eir_len 31 src/shared/mgmt.c:can_read_data() [0x0000] event 0x0006 profiles/input/server.c:connect_event_cb() Incoming connection from EC:83:50:76:BD:67 on PSM 17 profiles/input/device.c:input_device_set_channel() idev 0x5580c6a331b0 psm 17 profiles/input/server.c:confirm_event_cb() profiles/input/server.c:connect_event_cb() Incoming connection from EC:83:50:76:BD:67 on PSM 19 profiles/input/device.c:input_device_set_channel() idev 0x5580c6a331b0 psm 19 profiles/input/device.c:hidp_add_connection() Could not parse HID SDP record: No such file or directory (2) profiles/input/device.c:ctrl_watch_cb() Device EC:83:50:76:BD:67 disconnected profiles/input/device.c:intr_watch_cb() Device EC:83:50:76:BD:67 disconnected This commit sets BREDR svc_resolved to false if the ServiceRecords entry is not present in the cache file, triggering service rediscover on next device connection. Frédéric Danis 8 months ago 1 file, +33, -4
c29bb3f9 shared/asha: Only update device set after start succeeds This ensures that one side's connected status is only exposed to the other after the connection is actually complete. Arun Raghavan 8 months ago 1 file, +1, -2
cb8f216f Add .editorconfig file for basic formatting See https://editorconfig.org Luiz Augusto von Dentz 8 months ago 1 file, +29, -0
42f5184b Add support clang-format This adds .clang-format (based on kernel) which can be used by linters, editors, etc to check the coding style. Luiz Augusto von Dentz 8 months ago 1 file, +119, -0
faca96e9 workflows: Add lint action This adds lint action replacing the custom CI one which will be going to be disabled. Luiz Augusto von Dentz 8 months ago 1 file, +32, -0
55b02fe5 workflows: Add checkpatch action This adds checkpatch action rather replacing the custom CI one which will be going to be disabled. Luiz Augusto von Dentz 8 months ago 1 file, +14, -0
b74d30fb bass: remove the device of BIS source when modify operation. When the Client sends a modify operation and PA Sync is "Do not synchronize to PA", the BIS source information needs to be cleared. Fixes: https://github.com/bluez/bluez/issues/1145 Yang Li 8 months ago 1 file, +6, -0
08e32773 sixaxis: Set security level when adding a sixaxis device When doing the cable pairing for a sixaxis, we may need to change the listening input server security level. This is because sixaxis gamepads can only work with the level BT_IO_SEC_LOW. Ludovico de Nittis 8 months ago 1 file, +3, -0
ba101f47 input: Automatically use sec level low when using a cable paired device BT_IO_SEC_LOW is the only way to allow devices that use cable pairing to establish a connection. This adds the ability to start the listening input server with BT_IO_SEC_LOW to avoid breaking support for these devices, and then, in `hidp_add_connection()`, we check if either `classic_bonded_only` was disabled or if this device has `CablePairing`. If neither are true, we bump the security back to BT_IO_SEC_MEDIUM, i.e. enforcing encryption. This allows supporting these devices without having to change the classic bonded only option. Ludovico de Nittis 8 months ago 4 files, +83, -7
c5dffe0c adapter: Add btd_adapter_has_cable_pairing_devices() Add a function that can be used to know if any of the known devices have the `CablePaired` property set. Ludovico de Nittis 8 months ago 2 files, +18, -0
56516d6c sixaxis: Set CablePairing when pairing a Sixaxis with USB Sixaxis gamepads don't support encryption. When doing the USB cable pairing, set the CablePairing property to keep the connection to the device unencrypted. Ludovico de Nittis 8 months ago 1 file, +4, -1
373146be client: Print CablePairing property When using the `info` command, include the new CablePairing value. Ludovico de Nittis 8 months ago 1 file, +1, -0
20ea34e7 src: Add new CablePairing property This adds initial support for a new CablePairing property. The property can be used for devices that are paired using a cable and don't support the expected bonding (with pairing/encryption), for example like the Sixaxis gamepads. Ludovico de Nittis 8 months ago 3 files, +50, -0
c8bce657 workflows/sync: Remove workflow job The workflow branch update is not needed now that action-ci no longer use to base the PR and CI tasks. Luiz Augusto von Dentz 8 months ago 1 file, +1, -14
9a769a3a workflows: Make use bluez/action-ci action This replaces the bzcafe action with bluez/action-ci so we can maintain everything in the github bluez organization. Luiz Augusto von Dentz 8 months ago 2 files, +3, -3
62967230 shared/asha: Use a more descriptive name for the state callback Arun Raghavan 8 months ago 2 files, +14, -14
1b137c4b profiles/audio: asha: Only expose device after we have attributes Let's get the PSM and read-only properties before we expose the device and transport. While we're at it, rename "probe" as "attach" for consistency. Arun Raghavan 8 months ago 3 files, +41, -7
918432b2 profiles/audio: asha: Reset state on disconnect Sanchayan Maity 8 months ago 1 file, +2, -0
6c582e7e audio/source: Fix crash on authentication failure The AVDTP reference count may decrease under 0 if authentication fails and avdtp_unref() is called from source_unregister() then when changing state from SOURCE_STATE_CONNECTING to SOURCE_STATE_DISCONNECTED: src/shared/mgmt.c:can_read_data() [0x0000] event 0x000b src/adapter.c:connected_callback() hci0 device EC:28:D3:0B:3B:7B connected eir_len 33 src/shared/mgmt.c:can_read_data() [0x0000] event 0x0011 src/adapter.c:bonding_attempt_complete() hci0 bdaddr EC:28:D3:0B:3B:7B type 0 status 0x5 src/device.c:device_bonding_complete() bonding (nil) status 0x05 src/device.c:device_bonding_failed() status 5 src/adapter.c:resume_discovery() src/profile.c:ext_connect() Hands-Free unit failed connect to EC:28:D3:0B:3B:7B: Permission denied (13) src/service.c:change_state() 0x556200cee6d0: device EC:28:D3:0B:3B:7B profile Hands-Free unit state changed: connecting -> disconnected (-13) src/device.c:device_profile_connected() Hands-Free unit Permission denied (13) profiles/audio/a2dp.c:a2dp_source_connect() path /org/bluez/hci0/dev_EC_28_D3_0B_3B_7B profiles/audio/avdtp.c:avdtp_ref() 0x556200d2fb80: ref=1 profiles/audio/avdtp.c:avdtp_ref() 0x556200d2fb80: ref=2 profiles/audio/a2dp.c:setup_ref() 0x556200cf3760: ref=1 profiles/audio/source.c:source_set_state() State changed /org/bluez/hci0/dev_EC_28_D3_0B_3B_7B: SOURCE_STATE_DISCONNECTED -> SOURCE_STATE_CONNECTING profiles/audio/source.c:source_connect() stream creation in progress src/service.c:change_state() 0x556200d08470: device EC:28:D3:0B:3B:7B profile a2dp-source state changed: disconnected -> connecting (0) src/service.c:btd_service_unref() 0x556200cee6d0: ref=1 src/shared/mgmt.c:can_read_data() [0x0000] event 0x000c src/adapter.c:dev_disconnected() Device EC:28:D3:0B:3B:7B disconnected, reason 0 src/adapter.c:adapter_remove_connection() src/device.c:device_remove_connection() connection removed while Connect() is waiting reply plugins/policy.c:disconnect_cb() reason 0 src/adapter.c:bonding_attempt_complete() hci0 bdaddr EC:28:D3:0B:3B:7B type 0 status 0xe src/device.c:device_bonding_complete() bonding (nil) status 0x0e src/device.c:device_bonding_failed() status 14 src/adapter.c:resume_discovery() src/service.c:change_state() 0x556200d08470: device EC:28:D3:0B:3B:7B profile a2dp-source state changed: connecting -> disconnected (-103) src/device.c:device_profile_connected() a2dp-source Software caused connection abort (103) src/service.c:change_state() 0x556200d08470: device EC:28:D3:0B:3B:7B profile a2dp-source state changed: disconnected -> unavailable (0) profiles/audio/source.c:source_unregister() /org/bluez/hci0/dev_EC_28_D3_0B_3B_7B profiles/audio/avdtp.c:avdtp_unref() 0x556200d2fb80: ref=1 profiles/audio/a2dp.c:setup_ref() 0x556200cf3760: ref=2 profiles/audio/a2dp.c:setup_unref() 0x556200cf3760: ref=1 profiles/audio/a2dp.c:a2dp_cancel() aborting setup 0x556200cf3760 profiles/audio/a2dp.c:setup_unref() 0x556200cf3760: ref=0 profiles/audio/a2dp.c:setup_free() 0x556200cf3760 profiles/audio/avdtp.c:avdtp_unref() 0x556200d2fb80: ref=0 profiles/audio/avdtp.c:avdtp_ref() 0x556200d2fb80: ref=1 profiles/audio/avdtp.c:connection_lost() Disconnected from EC:28:D3:0B:3B:7B profiles/audio/source.c:source_set_state() State changed /org/bluez/hci0/dev_EC_28_D3_0B_3B_7B: SOURCE_STATE_CONNECTING -> SOURCE_STATE_DISCONNECTED profiles/audio/avdtp.c:avdtp_unref() 0x556200d2fb80: ref=0 profiles/audio/avdtp.c:avdtp_free() 0x556200d2fb80 profiles/audio/a2dp.c:channel_remove() chan 0x556200cf5400 profiles/audio/avdtp.c:avdtp_unref() 0x556200d2fb80: ref=-1 profiles/audio/avdtp.c:avdtp_free() 0x556200d2fb80 This has been tested with: - BlueZ 5.77 + kernel 5.4 - BlueZ upstream + kernel 6.11 Frédéric Danis 8 months ago 1 file, +3, -1
2d98e08d workflows/sync: Fix action Luiz Augusto von Dentz 8 months ago 1 file, +14, -11
e06ed622 workflow/sync: Fix workflow task Sync repo from bzcafe does assume that syncing with master has not happened yet, thus it aborts before syncing the workflow branch which is required for patchwork task to create PRs. Luiz Augusto von Dentz 8 months ago 1 file, +7, -4
3e9827d3 workflows/sync: Add Cleanup PR and Sync Workflow This adds the missing tasks of Cleanup PR and Sync Workflow which are required in order to properly handle the PRs. Luiz Augusto von Dentz 8 months ago 1 file, +13, -0
46e6a385 workflows: Add sync action This adds sync action which was part of https://github.com/bluez/actions/ but it gets disabled every 60 days due to inactivity, in addition to syncing with upstream repositories it also syncs with patchwork which created the PR and then triggers ci action to do the testing. Luiz Augusto von Dentz 8 months ago 1 file, +45, -0
3616d514 workflows: Add CI action This adds CI action which was previously under BlueZTestBot. Luiz Augusto von Dentz 8 months ago 1 file, +24, -0
e4c1d03e eir: Use Broadcast Name as Device.Name This makes use of Broadcast Name advertising data field as device name so it can be identified by upper layer. Luiz Augusto von Dentz 8 months ago 2 files, +3, -1
Previous Next