AppArmor DENIES swtpm pid file access
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
swtpm |
Unknown
|
Unknown
|
|||
libvirt (Ubuntu) |
Won't Fix
|
Undecided
|
Lena Voytek | ||
Kinetic |
Won't Fix
|
Undecided
|
Lena Voytek | ||
Lunar |
Won't Fix
|
Undecided
|
Lena Voytek | ||
swtpm (Ubuntu) |
Fix Released
|
Undecided
|
Lena Voytek | ||
Kinetic |
Fix Released
|
Undecided
|
Lena Voytek | ||
Lunar |
Fix Released
|
Undecided
|
Lena Voytek |
Bug Description
[Impact]
When attempting to set up a vm with libvirt using swtpm in Kinetic, swtpm's apparmor profile will deny access to the pid file in /run/libvirt/
The fix for this issue should be backported to Kinetic because it blocks all users attempting to set up a libvirt TPM vm with an error.
This bug is fixed by removing the "owner" tag from the line "owner /run/libvirt/
[Test Plan]
The fix can be tested using virt-manager and an os using TPM:
# sudo apt update && sudo apt dist-upgrade -y
# sudo apt install virt-manager swtpm
Create a vm in virt-manager and on the last page
> Select "Customize configuration before install"
> Click Finish
> Click Add Hardware
> Select TPM with Model "TIS" and version 2.0
> Click "Begin Installation"
[Where problems could occur]
By removing the owner tag in line in the apparmor profile, any file with a .pid extension in /run/libvirt/
[Original Description]
libvirt 8.6.0-0ubuntu1
apparmor 3.0.7-1ubuntu1
One of our CI tests runs virt-install in a specific way that ultimately fails with this in the error message:
ERROR internal error: Could not get process id of swtpm
The journal has this message:
audit: type=1400 audit(166262852
This is nested virtualization. If you need the exact invocation of virt-install, I can dig that out.
Related branches
- git-ubuntu bot: Approve
- Athos Ribeiro (community): Approve
- Canonical Server Reporter: Pending requested
-
Diff: 28 lines (+8/-1)2 files modifieddebian/changelog (+7/-0)
debian/usr.bin.swtpm (+1/-1)
- git-ubuntu bot: Approve
- Andreas Hasenack: Approve
- Canonical Server Reporter: Pending requested
-
Diff: 28 lines (+8/-1)2 files modifieddebian/changelog (+7/-0)
debian/usr.bin.swtpm (+1/-1)
description: | updated |
Changed in libvirt (Ubuntu): | |
status: | Incomplete → Confirmed |
tags: | added: server-todo |
Changed in libvirt (Ubuntu): | |
assignee: | nobody → Lena Voytek (lvoytek) |
Changed in swtpm (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Lena Voytek (lvoytek) |
description: | updated |
Changed in swtpm (Ubuntu Kinetic): | |
status: | New → In Progress |
assignee: | nobody → Lena Voytek (lvoytek) |
Changed in libvirt (Ubuntu Kinetic): | |
assignee: | nobody → Lena Voytek (lvoytek) |
status: | New → Confirmed |
description: | updated |
Hello,
Thanks for the bug report. I attempted to reproduce using Kinetic with libvirt 8.6.0-0ubuntu1
and apparmor 3.0.7-1ubuntu1 but was unable to. This is probably due to my integration of swtpm into the vm. If you can find the exact parameters used for virt-install that would be great. Then I can try and reproduce the issue with more accuracy.