vhost-scsi triggers virt-aa-helper error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Forked from bug 1815910 as it is a different kind of problem and also a different fix.
FYI: this works just fine when defined at the time the guest starts.
libvirt mediates the access and passes an FD that at the time qemu can open and use.
Only later on when hot-plugging this occurs.
#1 prepare a scsi device to pass
$ sudo modprobe vhost-scsi
$ sudo targetcli backstores/block create name=disk1 dev=/dev/
$ sudo targetcli vhost/ create 50014059de6fba4f
$ sudo targetcli vhost/naa.
#2 describe the device to attach for libvirt
$ cat vhost-scsi.xml
<hostdev mode='subsystem' type='scsi_host' managed='no'>
<source protocol='vhost' wwpn='naa.
</hostdev>
#3 do the hotplug
$ virsh attach-device disco-vhost vhost-scsi.xml
error: Failed to attach device from vhost-scsi.xml
error: internal error: cannot update AppArmor profile 'libvirt-
When debugging this we see as expected triggers an error in virt-aa-helper:
/usr/lib/
unexpected exit status 1
virt-aa-helper: error: /sys/kernel/
virt-aa-helper: error: skipped restricted file
virt-aa-helper: error: invalid VM definition
CVE References
Changed in libvirt (Ubuntu): | |
status: | New → Triaged |
Since "the dawn of ages" a.k.a commit 51a4814f "Imported Upstream version 0.7.2" virt-aa-helper filters some paths [1].
/sys is one of them.
There is the feature to override certain sub-paths which is almost as old [2]:
We will have to register "/sys/kernel/ config/ target/ vhost" there as well.
[1]: https:/ /libvirt. org/git/ ?p=libvirt. git;a=blob; f=src/security/ virt-aa- helper. c;hb=bbaecd6a8f 15345bc822ab4b7 9eb0955986bb2fd #l467 /libvirt. org/git/ ?p=libvirt. git;a=commit; h=1efb623674463 2c579049ee610dc 1c8a42b3ee3d
[2]: https:/