bluetooth serial port (aka /dev/rfcommX) is not accessible by unprivileged user due to MM
Submitted by Viaheslav Gagara
Assigned to ModemManager bug user
Link to original bug (#105289)
Description
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"
Version: 1.6