[Bug 1093378] New: conflicting udev rules completely break USB Serial bridges
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378 Bug ID: 1093378 Summary: conflicting udev rules completely break USB Serial bridges Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: All OS: Other Status: NEW Severity: Critical Priority: P5 - None Component: Basesystem Assignee: bnc-team-screening@forge.provo.novell.com Reporter: sbrabec@suse.com QA Contact: qa-bugs@suse.de CC: jreuter@suse.com, kkaempf@suse.com, matwey.kornilov@gmail.com, mbrugger@suse.com, mgorse@suse.com, oneukum@suse.com, ro@suse.com, sckang@suse.com, sndirsch@suse.de, stefan.bruens@rwth-aachen.de, trenn@suse.com Depends on: 1092839, 1007652 Found By: --- Blocker: --- Following USB ids represent most common generic USB UART Bridges: 10C4:EA60 CP210x UART Bridge https://usb-ids.gowdy.us/read/UD/10c4/ea60 10C4:EA80 CP2110 HID UART Bridge https://usb-ids.gowdy.us/read/UD/10c4/ea80 0403:6001 FT232 USB-Serial (UART) IC https://usb-ids.gowdy.us/read/UD/0403/6001 (There are more such chips and ids) Many hardware vendors ignore rules and sell their products with this generic USB ids. As as result, plugging of such device starts an udev rule fight, which actually ends by a completely non-functional device. Actually, these applications fight for these devices: brttty: Recognizes it as a Braille terminal or display (bug 1092839) upower: Recognizes it as a Watts Up? Pro gpsd: Recognizes it as SiRF Star III 20ch Gmouse GPS (or another GPS device for other ids) ModemManager: Recognizes it as a modem candidate argyllcms: Recognized as JETI & KLEIN Spectrophotometer (bug 1007652, already fixed) Other packages that might attempt to steal these ids as well (or at least did it in past): avrdude: Recognizes it as a AVR programmer sigrok: Recognizes it as CEM DT-8852, Dangerous Prototypes Buspirate, ChronoVu LA8, ChronoVu LA16 openocd: Sets it up as a serial bridge to the embedded device (hopefully, only privileges are set) Found by: grep -ir '\(6001\|ea60\|ea80\)' /usr/lib/udev/rules.d /etc/udev/rules.d If hardware vendors ignore rules and release a device with a USB UART Bridge id and textual identification, Linux has no chance to recognize the device plugged. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c1
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c3
--- Comment #3 from Matwey Kornilov
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
Stefan Dirsch
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c4
--- Comment #4 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c5
--- Comment #5 from Matwey Kornilov
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c6
--- Comment #6 from Matwey Kornilov
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c7
--- Comment #7 from Matwey Kornilov
The second question is how this VendorID/DeviceID issue is managed on Windows?
Probably they just use USB device class to distinguish different devices. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c8
--- Comment #8 from Stefan Brüns
So, the issue is that udev default rules allows uncontrollable device rebinding. What if we drop this rules and left it for users to allow device rebinding based on USB device serial number (for instance)? There could be template in /etc/udev/rules.d to fill serial and uncoment.
Silabs (CP210x) USB-serial chips can be reprogrammed (http://cp210x-program.hg.sourceforge.net/hgweb/cp210x-program/cp210x-program...) with unique serial numbers, but everything you get from your friendly least-untrusted internet seller has a "0" as its serial number. I don't know about the Braille devices, but if these vendors are incapable to request a Product ID from the chip vendor, they don't likely care for useful serial numbers (other than "1234ABCD"). ModemManager IIRC actually has a sensible approach, it white- or graylists items. Whitelisted items are guaranteed to be modems (e.g. by correct USB VID/PID, interface), graylisted items are allowed to be probed manually. We have two/three? different classes of services using these "serial" ports: - programms acessing the port on request, e.g. argyllcms, sigrok, avrdude - daemons running as a system service (upower, ModemManager, gpsd, ...) - daemons running in a user session? Critical are the ones in the second group, as these may be fighting over the device. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c9
--- Comment #9 from Stefan Brüns
(In reply to Matwey Kornilov from comment #6)
The second question is how this VendorID/DeviceID issue is managed on Windows?
Probably they just use USB device class to distinguish different devices.
They probably just install software package to access the device, not multiple, and configure it explicitly. I am quite sure if you e.g. install a braille device and a GPS mouse with the same serial converter chip and swap the USB port you end up with two unusable devices. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c10
--- Comment #10 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c11
--- Comment #11 from Stefan Brüns
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c12
--- Comment #12 from Stefan Brüns
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c13
--- Comment #13 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c14
--- Comment #14 from Stefan Brüns
Looking at strace log, it seems that brltty indeed does a probe, but it loops forever on a bare CP2101 device. And if I kill brltty, device remains in an unusable state (/dev/ttyS0 does not exist).
Can you create a backtrace, to get an idea which device/brltty driver is misbehaving? The driver likely uses libusb to detach the kernel driver, but fails to reattach in case it is forcefully killed. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c15
Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c16
--- Comment #16 from Stanislav Brabec
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c31
Günter Halt
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c32
--- Comment #32 from Stefan Brüns
(In reply to Stefan Brüns from comment #29)
(In reply to Martin Wilck from comment #28)
(In reply to Stefan Brüns from comment #27)
So I doubt one could catch everything with some BLACKLIST_foo option.
IMO it would work for everything that's proved by udev. User-space tools that try to access devices directly would need explicit support, which opens a can of worms.
Thats no differentiation: 1. The device is hot-/cold-plugged 2. The kernel loads a driver and generates a udev event 3. udev starts some kind of userspace "helper", e.g. gpsd, brltty 4a. the helper *may* detach the kernel driver and use e.g. libusb, or 4b. the helper opens e.g. the tty port
I was talking about processing "SUBSYSTEM==usb" events in step 3.
That's the stage at which to decide which upper level driver to use, no matter whether it's kernel or user-space. blacklisted helpers wouldn't even be tried. Selecting which modules to load, or which helpers to try, is very well possible at this stage, and can be implemented completely in udev rules. But I may be missing your point.
Udev sees e.g. a CP2102, with the corresponding USB VID/PID. Although device vendors could use their own VID/PID, too many don't. The CP2102 can be anything, a sole USB-TTY-converter, a braille device, a GPS mouse, a scope, a power supply.
The "can of worms" referred to cases where a helper is started by some other means (i.e. other than udev), and tries probing devices by itself. Sane tools will be looking at the udev properties already, yet some may need to be prevented from detaching competing drivers.
The available properties are in many cases not sufficient to even determine the device type. -- You are receiving this mail because: You are on the CC list for the bug.
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378
http://bugzilla.opensuse.org/show_bug.cgi?id=1093378#c33
--- Comment #33 from Martin Wilck
participants (1)
-
bugzilla_noreply@novell.com