[Pkg-bluetooth-maintainers] Bug#810487: bluez: should not use hciconfig up to power bluetooth adapters

Aurelien Jarno aurel32 at debian.org
Fri Jan 8 23:25:31 UTC 2016


Package: bluez
Version: 5.23-2+b1
Severity: normal

Dear Maintainer,

I got difficulties to get bluetooth devices with SMP enabled (Security
Manager Protocol) with recent kernels. I haven't fully try to find the
exact version, but looking on the internet it seems the issue started
with version 4.1.6. It seems it was working by chance before, and that
the commit 25ba2653 (Bluetooth: Fix NULL pointer dereference in
smp_conn_security) make it always fail.

According to one of the bluetooth maintainer [1], the problem is that
the bluetooth adapter is started with the legacy command hciconfig,
which doesn't initialize the security context. Indeed I have found a
call to such command in the 50-bluetooth-hci-auto-poweron.rules udev
rule. I have tried to replace it with a more modern command using dbus,
but it seems to fail as the bluetooth daemon is not working at that
time. I have been able to workaround that with a ugly sleep command. I
ended up with the following rules file, which allow my bluetooth mouse
to work correctly:

# Set bluetooth power up
ACTION=="add", SUBSYSTEM=="bluetooth", KERNEL=="hci[0-9]*", RUN+="/bin/sh -c 'sleep .5 ; /usr/bin/dbus-send --system --type=method_call --dest=org.bluez /org/bluez/%k org.freedesktop.DBus.Properties.Set string:org.bluez.Adapter1 string:Powered variant:boolean:true'"

There is probably a better way to do that, but I don't know the bluez
stack enough to avoid the sleep command.

Regards,
Aurelien

PS: the problem is reported from a jessie system as I don't have a sid
system around with bluetooth available for now, but I have reasons to
believe the problem is still the same in sid.

[1] http://www.spinics.net/lists/linux-bluetooth/msg64021.html

-- System Information:
Debian Release: 8.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-0.bpo.1-amd64 (SMP w/4 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages bluez depends on:
ii  dbus                 1.8.20-0+deb8u1
ii  init-system-helpers  1.22
ii  kmod                 18-3
ii  libc6                2.19-18+deb8u1
ii  libdbus-1-3          1.8.20-0+deb8u1
ii  libglib2.0-0         2.42.1-1
ii  libreadline6         6.3-8+b3
ii  libudev1             215-17+deb8u2
ii  lsb-base             4.1+Debian13+nmu1
ii  udev                 215-17+deb8u2

bluez recommends no packages.

bluez suggests no packages.

-- no debconf information

-- debsums errors found:
debsums: changed file /lib/udev/rules.d/50-bluetooth-hci-auto-poweron.rules (from bluez package)



More information about the Pkg-bluetooth-maintainers mailing list