Bug 105289 - bluetooth serial port (aka /dev/rfcommX) is not accessible by unprivileged user due to MM
Summary: bluetooth serial port (aka /dev/rfcommX) is not accessible by unprivileged us...
Status: RESOLVED MOVED
Alias: None
Product: ModemManager
Classification: Unclassified
Component: general (show other bugs)
Version: 1.6
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: ModemManager bug user
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-28 12:13 UTC by Viaheslav Gagara
Modified: 2018-06-10 09:05 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Viaheslav Gagara 2018-02-28 12:13:20 UTC
When BT serial port added by blueman and /dev/rfcommX is created then it appears that MM claims it which results in "/dev/rfcomm0: Device or resource busy" for unprivileged user.
There are lots of reports about this. e.g.:
https://bugzilla.redhat.com/show_bug.cgi?id=910229
https://github.com/blueman-project/blueman/issues/524

As I see MM has partial fix for this in 80-mm-candidate.rules
```
KERNEL=="rfcomm[0-9]*", DEVPATH=="*/virtual/*", GOTO="mm_candidate_end"
```
which works fine when I create serial port manually like `rfcomm bind /dev/rfcomm0 <dev>`
but when it is created with blueman then additional devices created/moved which seems not covered by the rule above.
i.e. in my case udevadm reports following when I create serial port with blueman:
```
KERNEL[22819.788762] add      /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:256 (bluetooth)
UDEV  [22819.789485] add      /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:256 (bluetooth)
KERNEL[22820.671298] add      /devices/virtual/tty/rfcomm2 (tty)
KERNEL[22820.671324] move     /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:256/rfcomm2 (tty)
UDEV  [22820.671615] add      /devices/virtual/tty/rfcomm2 (tty)
UDEV  [22820.672638] move     /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.0/bluetooth/hci0/hci0:256/rfcomm2 (tty)
```
Adding following rule fixes problem for me:
```
KERNEL=="rfcomm[0-9]*", DEVPATH=="*/bluetooth/*", GOTO="mm_candidate_end"
```
Comment 1 GitLab Migration User 2018-06-10 09:05:46 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/72.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.