Public bug reported:

Libvirt-aa-helper seems to have a bug when adding usb passthrough
devices statically.

On hotplug with:
$ cat sandisk-usb.xml
<hostdev mode='subsystem' type='usb' managed='yes'>
    <source>
        <!--
          idVendor           0x0781 SanDisk Corp.
          idProduct          0x5580 SDCZ80 Flash Drive
        -->
        <vendor id='0x0781'/>
        <product id='0x5580'/>
    </source>
</hostdev>

$ virsh attach-device z-test1 sandisk-usb.xml

It generates correctly:
"/dev/bus/usb/003/003" rw,

But if adding the same XML part to the guest xml itself it generates:
"/dev/bus/usb/000/000" rw,

And as a follow on issue the guest start fails with:
libusb: error [_get_usbfs_fd] libusb couldn't open USB device 
/dev/bus/usb/003/003: Permission denied
Due to:
apparmor="DENIED" operation="open" 
profile="libvirt-adc578cb-905f-41fc-9be2-9fb81f6a6073" 
name="/dev/bus/usb/003/003" pid=22879 comm="qemu-system-x86" 
requested_mask="wr" denied_mask="wr" fsuid=123 ouid=123

** Affects: libvirt (Ubuntu)
     Importance: Medium
         Status: Triaged


** Tags: server-next virt-aa-helper

** Changed in: libvirt (Ubuntu)
       Status: New => Triaged

** Changed in: libvirt (Ubuntu)
   Importance: Undecided => Medium

** Tags added: server-next

** Tags added: virt-aa-helper

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1686324

Title:
  usb hostdev passthrough generates the wrong apparmor rules

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1686324/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to