libvirt-qemu apparmor profile doesn't allow locking of AAVMF firmware
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libvirt |
Fix Released
|
Unknown
|
|||
libvirt (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Committed
|
Undecided
|
Christian Ehrhardt | ||
Jammy |
Fix Released
|
Undecided
|
Christian Ehrhardt |
Bug Description
[ Impact ]
* Qemu on arm64 changed behavior now trying to ensure exclusivity on the
AAVM files used by OVMF. That is stopped by apparmor and needs to be
allowed to function again (as it used to prior to jammy before the
locking took place).
* The fix does not change the code, instead it changes the rule for
the specific path in the guest-associated apparmor rule and
adds "k" (=locking) to it.
[ Test Plan ]
* On arm64 you can try to spawn an OVMF using test system
(from the upstream report):
$ virt-install --name test --ram 1024 --vcpus 2 --disk size=16 --location https:/
Without the fix that will emit an apparmor denial like:
apparmor=
With the fix that apparmor denial will not occur and it reaches further
stages of guest initialization.
For tests on focal only a subset trigger with the qemu in focal, but any self-build or backport, like the one from https:/
[ Where problems could occur ]
* Since it "only" changes apparmor rules and in doing so only "widens"
what is allowed there should be not many problems, those I can think of
are
- Conffile churn: this changes a conffile and despit all documentation
pointers and hints to use a local override some people have changes.
So we might override some of those or at least trigger conffile
prompts.
- Usually restricting apparmor is more risky than opening it up. The
one pattern that could happen is that in some places something
"expected to fail will now work. But that is the purpose of the fix.
- gladly AAVMF is only used for arm, so other platforms should be
"even more unaffected"
[ Other Info ]
* a return of bug 1709818 but for a different file type
---
[Filing https:/
Qemu tries to lock the uefi firmware image during vm creation, but the libvirt-supplied apparmor profile prevents this for the AAVMF firmware, and qemu fails with:
qemu-system-arm: Failed to lock byte 100
The solution is adding the "k" flag to the relevant apparmor profile. This is fixed upstream by this commit:
https:/
which is already included in the libvirt version in Kinetic.
Related branches
- git-ubuntu bot: Approve
- Sergio Durigan Junior (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 117 lines (+89/-0)4 files modifieddebian/changelog (+7/-0)
debian/patches/series (+2/-0)
debian/patches/ubuntu/lp-1989078-apparmor-Allow-locking-AAVMF-firmware.patch (+32/-0)
debian/patches/ubuntu/lp-1989078-apparmor-Fix-QEMU-access-for-UEFI-variable-files.patch (+48/-0)
- git-ubuntu bot: Approve
- Paride Legovini (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 65 lines (+43/-0)3 files modifieddebian/changelog (+7/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu/lp-1989078-apparmor-Allow-locking-AAVMF-firmware.patch (+35/-0)
Changed in libvirt (Ubuntu Jammy): | |
status: | New → Triaged |
Changed in libvirt (Ubuntu): | |
status: | New → Fix Released |
tags: | added: server-todo |
Changed in libvirt: | |
status: | Unknown → Fix Released |
description: | updated |
description: | updated |
Changed in libvirt (Ubuntu Jammy): | |
status: | Triaged → In Progress |
tags: | removed: server-todo |
description: | updated |
Changed in libvirt (Ubuntu Focal): | |
assignee: | nobody → Christian Ehrhardt (paelzer) |
tags: | removed: server-todo |
Thanks @J.S. indeed for the report.
And thanks Paride for the re-triage into a new bug - that was just right.
It is indeed the same as in the past and fixed the same way but for a new file path.
Therefore we do not need much external checks to wait for.
And gladly since it is in v8.4.0 is is already fixed in Kinetic and we can start with the SRU right away.
I backported the fix and provided a PPA with it for testing if you want.
Prepared a fix here for test and review: /launchpad. net/~paelzer/ +archive/ ubuntu/ lp-1989078- aavmf-locking /launchpad. net/~paelzer/ +archive/ ubuntu/ lp-1989078- aavmf-locking
- PPA: https:/
- MP: https:/