libvirt: When installing two or more identical usb devices in a VM, only one works
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Debian) |
Fix Released
|
Unknown
|
|||
libvirt (Fedora) |
Fix Released
|
High
|
|||
libvirt (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Medium
|
Serge Hallyn |
Bug Description
The problem is described in this bug:
https:/
"libvirt ignores address bus= device= when identicle vendor ID/product IDs usb devices attached with either virsh or virt-manager"
That bug is closed, but the problem is present in 0.9.8-2ubuntu17.4 (ubuntu server precise lts)
Can anyone confirm if there is a version that solves this in ubuntu and how to install it in last LTS?
Thank you!
=======
SRU Justification:
1. Impact: starting a VM with two usb devices with same vendor/id causes one to be ignored.
2. Development fix: looks over a list of usb devices with vendor/id.
3. Stable fix: backported patches from development fix.
4. Test case:
======== test case start ========
Steps to Reproduce:
1. Connect 2 USB to serial converters to the hypervisor
2. Use virt-manager to attach them to the guest. The XML hostdev part should read similar to:
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x067b'/>
<product id='0x2303'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<vendor id='0x067b'/>
<product id='0x2303'/>
</source>
</hostdev>
3. Inside virsh edit XML description of the device specifying address bus= device= for each device (virt-manager does not differentiate them) The XML should end like this:
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='002' device='005'/>
</source>
</hostdev>
<hostdev mode='subsystem' type='usb' managed='yes'>
<source>
<address bus='002' device='006'/>
</source>
</hostdev>
4) use virsh dumpxml <domain-id> and see the hostdev tag
Actual results:
Both devices have same bus and device, and inside the guest only /dev/ttyUSB0 is present.
Expected results:
Each device should respect the configured values in step 3 and in the guest there should be two devices i.e. /dev/ttyUSB0 and /dev/ttyUSB1
======== test case end ========
5. Regression potential: Only usb-related code should be affected, and all qa-regression-tests passed with this fix.
=======
Related branches
CVE References
summary: |
- When installing two or more identical usb devices, only one works + libvirt: When installing two or more identical usb devices in a VM, only + one works |
tags: | added: precise upgrade-software-version |
tags: | removed: upgrade-software-version |
information type: | Public → Public Security |
information type: | Public Security → Public |
tags: | added: upgrade-software-version |
Changed in libvirt (Ubuntu): | |
status: | New → Confirmed |
Changed in libvirt (Debian): | |
status: | Unknown → Fix Released |
Changed in libvirt (Ubuntu Precise): | |
assignee: | nobody → Serge Hallyn (serge-hallyn) |
status: | Triaged → In Progress |
description: | updated |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
Changed in libvirt (Fedora): | |
importance: | Unknown → High |
status: | Unknown → Fix Released |
+++ This bug was initially created as a clone of Bug #815755 +++
Description of problem:
Version-Release number of selected component (if applicable):
How reproducible: 100%
Steps to Reproduce:
1. Take 2 RSA Tokens and connect them to a hypervisor
2. Use lsusb -v to find a uniquely identifyable property of each device
3. Either
a) use virt-manager to attach the device with highest bus:device address to a guest
OR
b) write an XML description of the device specifying address bus= device= for the highest numbered RSA token
# virsh attach-device <domain-id> <xml-file>
4) use virsh dumpxml <domain-id> and see which device is actually attached to the guest
Actual results:
The device with the lowest bus:device address and matching vendor:product id is attached to the guest
Expected results:
The device specified by the address bus= device= in the XML, or the device selected in the virt-manager GUI should be attached to the guest
Additional info:
In order to confirm the wrong device is attached, login to the guest and run lsusb -v and search for the uniquely identifyable property of the device.
e.g. my RSA Token has bMaxPacketSize0 = 64, but for many of my colleagues it is 32.