-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate inconsistent ordering of PCI bus IDs for USB devices #307
Investigate inconsistent ordering of PCI bus IDs for USB devices #307
Comments
We've allocated a 4 hour timebox for this investigation during the 8/7-8/21 sprint. I can help with upstream coordination if required. |
It looks like this is due to how XHCI support in Linux handles USB 2.0. Check out the output from
There are two buses, usb2 and usb3, using the xhci_hcd driver, both of which are associated with the computer's single XHCI controller:
Note the PCI id and see:
When I connect my (Brother HL2390DW) printer, which uses USB 2.0, it gets connected to usb2 and has the sys-usb id 2-2. When I connect a USB 3.0 stick, it gets assigned to usb3 and has an id of 3-2. (The other EHCI (USB 2.0) controller and the usb1 bus is just for HID and I don't think we can use it.) This would suggest a few workarounds/solutions:
One complication that I saw a couple of times was a USB 3.0 stick getting attached as a USB 2.0 device. I'm not sure why this was happening and I can't replicate it, but I can replicate the USB 2.0 printer being attached to |
Next step here is to test if (3) is even possible, by setting up persistent attachments for both the 2.0 and 3.0 versions of a port and seeing if the export VM will boot with only one (or none) attached. |
Thanks! The agreed upon time-boxed investigation here was completed; moving follow-up work back to the near-term backlog for now. |
In testing the export feature, I experienced additional inconsistency of the ordering of the bus ID in
Note that the string identifiers may also differ between VMs (one drive was reported as "Kanguru" in Because the export code parses In discussions about this today, @creviera suggested |
I was able to repro the issue reported by @eloquence:
After updating usb device to
|
Unfortunately this doesn't work, I just tested this scenario: qvm-usb attach operation requires the device to be available at the time of the attachment. We cannot have |
@rmol will prototype the approach outlined in freedomofpress/securedrop-export#18 (comment): automatically attaching newly plugged in USB mass storage devices and printers to In this implementation, we want to make sure that users can still manually detach the device and attach it to another VM, to ensure advanced users aren't too fenced in by this approach. Even if this approach doesn't prove viable after prototyping, we still agree that the persistent attachment to the |
^ Doing the above prototyping work is our commitment for the 11/6-11/20 sprint, time-boxed to 16 hours. After that @rmol will make a recommendation on how to proceed. |
https://github.com/kushaldas/qdevd/blob/master/autoattach.py Here is one PoC for auto attachment of USB block storage device (any USB drive). This will attach the primary device (example The user can manually detach the device using the Qubes device menu, it will not auto-attached to anything. To auto attach again, the user will have to remove the device from the laptop and reattach it to the laptop. How to run?In
|
I've added a draft PR for the udev approach in #324. |
During review of freedomofpress/securedrop-export#5, @zenmonkeykstop reported that the PCI bus ID used by the same USB port will sometimes be different after attach/detach events, causing subsequent exports to fail. We want to better understand the root cause of this issue, and investigate if we can mitigate against it, or of this will potentially require upstream changes.
The text was updated successfully, but these errors were encountered: