Loading of libvirt profile fails in artful
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apparmor (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
libvirt (Ubuntu) |
Fix Released
|
High
|
Christian Ehrhardt |
Bug Description
Hi,
we have artful images since a few days - yay!
Unfortunately they run into issues.
I first thought this would be related to our slightly uncommon KVM-in-LXD setup but I can reproduce in nested KVM as well.
For simplicity I'll not mention the -in-lXD logs here as they are more noisy and less common.
I'm rather convinced if I'd have artful on bare metal it would show there as well but couldn't prove yet.
First of all aa-status looks sane to me:
$ sudo aa-status
apparmor module is loaded.
15 profiles are loaded.
15 profiles are in enforce mode.
/sbin/dhclient
/usr/
/usr/
/usr/
/usr/
/usr/
/usr/
/usr/
/usr/
/usr/
lxc-
lxc-
lxc-
lxc-
virt-aa-helper
0 profiles are in complain mode.
2 processes have profiles defined.
2 processes are in enforce mode.
/sbin/dhclient (850)
/usr/
0 processes are in complain mode.
0 processes are unconfined but have a profile defined.
But on actually creating a guest I get an apparmor related issue:
$ uvt-simplestrea
$ uvt-kvm create --password=ubuntu x-on-a-test release=xenial label=daily
uvt-kvm: error: libvirt: internal error: Process exited prior to exec: libvirt: error : unable to set AppArmor profile 'libvirt-
Along that I see this error about change_profile:
apparmor="DENIED" operation=
The same on a zesty system loads fine and dmesg holds a working reload.
$ uvt-simplestrea
$ uvt-kvm create --password=ubuntu x-on-z-test release=xenial label=daily
(working fine)
I cleared dmesg and started the guest on both to get all apparmor messages that are related:
Good case (zesty)
apparmor="STATUS" operation=
apparmor="STATUS" operation=
Bad case (artful)
apparmor="DENIED" operation=
I didn't see load/replace in artful so far.
There is a bug in the /etc/apparmor. d/abstractions/ libvirt- qemu file on line 183
/sys/ devices/ system/ cpu/cpu* /online r
is missing the the trailing , devices/ system/ cpu/cpu* /online r,
it should be
/sys/
this prevents libvirt from loading the vm profile. Unfortunately it does not report the error and only fails/reports the error when it attempts to transition to the profile that failed being loaded.
Once the abstraction is fixed nested kvm works as expected for me.
I have not tried this with an lxd container yet