ModemManager stuck opening serial port ttyUSBx

118 views
Skip to first unread message

Carlo Lobrano

unread,
Sep 22, 2021, 5:43:07 AM9/22/21
to Chromium OS Development
Hello,

testing a USB modem I noticed that the ModemManager gets stuck opening the serial port. The last message I could see is the following

ModemManager[5891] <debug> [modem0/ttyUSB3/at] opening serial port...

ttyUSB permissions look good, or similar to what I see in a linux machine (with modem group in place of the usual "dialout")

# ls -la /dev/ttyUSB*
crw-rw----. 1 root modem 188, 0 Sep 22 02:01 /dev/ttyUSB0
crw-rw----. 1 root modem 188, 1 Sep 22 02:01 /dev/ttyUSB1
crw-rw----. 1 root modem 188, 2 Sep 22 02:01 /dev/ttyUSB2
crw-rw----. 1 root modem 188, 3 Sep 22 02:01 /dev/ttyUSB3
crw-rw----. 1 root modem 188, 4 Sep 22 02:01 /dev/ttyUSB4

The modemmanager runs in minijail as user and group "modem", so it should be able to read/write on this devices.

I also tested running it as user root and it just works fine from the command-line, so I think it is a permission problem.


Carlo Lobrano

unread,
Sep 29, 2021, 7:49:29 AM9/29/21
to Chromium OS Development, Carlo Lobrano
I went a little bit further in this analysis.

I initially tested a pre-built image from February 2021, where this USB modem was working fine, and I compared the ModemManager configuration files, noticing that the /etc/init/modemmanager.conf file added a seccomp policy file in the meantime:

Following is the minijail command line in the chromiumOS image where the ModemManager gets stuck opening the tty

exec minijail0 -u modem -g modem -n -i -c cap_net_admin,cap_sys_admin=e -S /usr/share/policy/modemmanager.policy --/usr/sbin/ModemManager


while this is from the chromiumos image where Modemmanager works fine in the same context

exec minijail0 -u modem -g modem -n -i -c cap_net_admin,cap_sys_admin=e --/usr/sbin/ModemManager

In fact, removing the "-S" configuration from the first one, the ModemManager starts working as expected also in the first image.

Now, I am not sure how seccomp is enforced in chromeOS. I think that all the expected output is in /var/log/message (please correct me if I am wrong), where it looks like the major actor seems permission_broker, however it seems to allow (ALLOW_WITH_DETACH) the access to the usb modem:

Verdict for /dev/bus/usb/001/010: ALLOW_WITH_DETACH

but I am not sure if it refers to the driver option, or the Modemmanager

Any hint on how to proceed, or debug further, is well accepted, I think I can only consider now to generate a new policy file, from my own machine, and compare the differences.

Thanks,
Carlo Lobrano
Reply all
Reply to author
Forward
0 new messages