Apparmor blocks access to /dev/vhost-net
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Nova Compute Charm |
Invalid
|
Undecided
|
Unassigned | ||
libvirt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Won't Fix
|
Undecided
|
Unassigned | ||
Cosmic |
Won't Fix
|
Undecided
|
Unassigned | ||
Disco |
Won't Fix
|
Undecided
|
Unassigned | ||
Eoan |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
During attach new interface to the instance, I have an error (from dmesg):
[1387677.
Workaround is adding to: /etc/apparmor.
/dev/vhost-net rw,
More info:
Error that I get in nova-compute:
libvirtError: internal error: unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS
Libvirt version: 4.0.0-1ubuntu8.6
Ubuntu release: Bionic
Should libvirt be able to have access to /dev/vhost-net ?
Hi Daniel,
thank you for your report and your help making Ubuntu better.
Your workaround is exactly the right way flag your system for your special local configuration. apparmor. d/local/ abstractions/ libvirt- qemu
In later releases there is a file at:
/etc/
Which shall help to add a rule without conflicts on conffiles at package updates.
I assume that you have started the domain without any vhost-net device, but then hotplugged one. NET_BACKEND_ TYPE_QEMU and virDomainNetIsV irtioModel.
The rule for /dev/vhost-net is added on guest definition if a network device has VIR_DOMAIN_
That means if you start without any such device it won't be added at startup and late rat hotplug you hit the reported error.
I'd need to check if any of the relabeling calls that we have registered at virAppArmorSecu rityDriver could be made detecting a vhost device and adding that path in addition to what it was actually called for - maybe the FD for the vhost-dev gets a labeling call?
For now please confirm my assumption on your setup before I hunt a red herring in the code :-)