I am trying to debug a website displayed in Google Chrome on an Android device connected to my box via USB. To this end, there is the remote debugging protocol as implemented in the desktop versions of Google Chrome and Chromium. This is the context of the problem, but not the essence of my question.

The desktop chrome is able to communicate with the USB-attached android-chrome when Chrome and DevTools are run as root. I suspect that some character device in /dev is missing read / write access for my non-super-user. Therefore, when I run Chrome as jaroslav, the list of USB devices is empty.

Device detected as root:

superuser can read USB

Device missing for regular user:

non-root-user can not read USB

Strace to the rescue (?)

I want to determine which resources the application (desktop Chrome) is trying to access on my system, but as my knowledge of the platform is limited, I need advice on what to look for. Below is a list of unique system calls that the application uses. Do you know which of these are likely to be communication / negotiation calls to and from the USB device?

access          getrandom       rename
arch_prctl      getresgid       rt_sigaction
bind            getresuid       rt_sigprocmask
brk             getsockname     rt_sigreturn
clock_getres    gettid          sched_getparam
clone           ioctl           sched_getscheduler
close           listen          sendmsg
connect         lseek           sendto
creat           lstat           setpriority
dup             mkdir           set_robust_list
eventfd2        mmap            setsockopt
execve          mprotect        set_tid_address
fadvise64       mremap          shutdown
fallocate       msync           socket
fcntl           munmap          socketpair
fstat           open            stat
fstatfs         pipe            statfs
ftruncate       poll            symlink
futex           prctl           sysinfo
getdents        prlimit64       uname
geteuid         read            unlink
getpeername     readlink        wait4
getpid          recvfrom        write
getpriority     recvmsg         writev

I think chrome could be scanning for USB devices with (about 80 calls):

open("/sys/bus/pci/devices/0000:**:**.*/ \
     {class,device,irq,resource,vendor}", O_RDONLY) = 153

But they are not in /dev, so which devices do I need to open for reading for the regular user?

Here is what I have in /dev:

# ls -l hidraw* bus/usb/*/*
crw-rw-r-- 1 root usb     189,   0 180418 17:53 bus/usb/001/001
crw-rw-r-- 1 root usb     189,   1 180418 17:53 bus/usb/001/002
crw-rw-r-- 1 root usb     189, 128 180418 17:53 bus/usb/002/001
crw-rw-r-- 1 root usb     189, 129 180418 17:53 bus/usb/002/002
crw-rw-r-- 1 root usb     189, 256 180418 17:53 bus/usb/003/001
crw-rw-r-- 1 root usb     189, 257 180418 17:53 bus/usb/003/002
crw-rw-r-- 1 root usb     189, 258 180418 17:53 bus/usb/003/003
crw-rw-r-- 1 root usb     189, 259 180418 17:53 bus/usb/003/004
crw-rw-r-- 1 root usb     189, 260 180418 17:53 bus/usb/003/005
crw-rw---- 1 root plugdev 189, 263 180419 10:47 bus/usb/003/008
crw-rw-r-- 1 root usb     189, 384 180418 17:53 bus/usb/004/001
crw-rw-r-- 1 root usb     189, 385 180418 17:53 bus/usb/004/002
crw------- 1 root root    251,   0 180418 11:32 hidraw0
crw------- 1 root root    251,   1 180418 11:32 hidraw1
crw------- 1 root root    251,   2 180418 11:32 hidraw2

Perhaps all I need to do is to add jaroslav to the plugdev group? This is linux 4.12.12 with udev 236, by the way.

To sum up:

  1. Which system calls are likely to be related to USB communication?
  2. Which /dev nodes do I need to grant my user access to?
  • You are likely missing a udev rule. But I had experience with USB devices under Linux which did not work even with a perfectly crafted udev rule in place (USBASP Atmega programmers). Try Google groups and ask what rule you need. They might know and might be willing to share.
    – ajeh
    Apr 19, 2018 at 15:00


You must log in to answer this question.

Browse other questions tagged .