[Bug 2071478] Re: Add sys_admin capability to apparmor profile by default
Timo Aaltonen
2071478 at bugs.launchpad.net
Fri Aug 9 05:24:33 UTC 2024
Hello Lena, or anyone else affected,
Accepted swtpm into jammy-proposed. The package will build now and be
available at https://launchpad.net/ubuntu/+source/swtpm/0.6.3-0ubuntu3.3
in a few hours, and then in the -proposed repository.
Please help us by testing this new package. See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed. Your feedback will aid us getting this
update out to other Ubuntu users.
If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested, what testing has been
performed on the package and change the tag from verification-needed-
jammy to verification-done-jammy. If it does not fix the bug for you,
please add a comment stating that, and change the tag to verification-
failed-jammy. In either case, without details of your testing we will
not be able to proceed.
Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
advance for helping!
N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.
** Changed in: swtpm (Ubuntu Jammy)
Status: In Progress => Fix Committed
** Tags added: verification-needed verification-needed-jammy
** Changed in: swtpm (Ubuntu Noble)
Status: In Progress => Fix Committed
** Tags added: verification-needed-noble
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to swtpm in Ubuntu.
https://bugs.launchpad.net/bugs/2071478
Title:
Add sys_admin capability to apparmor profile by default
Status in swtpm package in Ubuntu:
Fix Released
Status in swtpm source package in Jammy:
Fix Committed
Status in swtpm source package in Mantic:
Won't Fix
Status in swtpm source package in Noble:
Fix Committed
Status in swtpm source package in Oracular:
Fix Released
Bug description:
[Impact]
The default apparmor profile for swtpm blocks access to kernel
modules, which causes a failure when using the --vtpm-proxy argument,
since it requires tpm_vtpm_proxy.
The fix for this should be backported so the vtpm-proxy works for
users by default.
The issue is fixed by adding the sys_admin capability, which gives
swtpm access to the required kernel modules
[Test Plan]
$ sudo apt update && sudo apt dist-upgrade -y
$ sudo apt install swtpm apparmor -y
$ mkdir /tmp/myvtpm
# Before fix
$ sudo modprobe tpm_vtpm_proxy
$ sudo swtpm chardev --vtpm-proxy --tpmstate dir=/tmp/myvtpm --tpm2 --ctrl type=tcp,port=2322
swtpm: Ioctl to create vtpm proxy failed: Operation not permitted
# After fix
$ sudo modprobe tpm_vtpm_proxy
$ sudo swtpm chardev --vtpm-proxy --tpmstate dir=/tmp/myvtpm --tpm2 --ctrl type=tcp,port=2322
New TPM device: /dev/tpm1 (major/minor = 253/1)
[Where problems could occur]
This change will allow swtpm to access various kernel modules by
default. So if malicious code were to exist within swtpm, then it
would have far greater access when running with super user
permissions.
Likewise, with a change to the apparmor profile, a conflict will occur
on update for users that modified their profile directly.
[Other Info]
The issue was fixed in oracular in 0.7.3-0ubuntu7.
[Original Description]
Based on the upstream discussion here -
https://github.com/stefanberger/swtpm/discussions/866 - certain
features of swtpm require access to kernel modules to work. For
example, using --vtpm-proxy requires the tpm_vtpm_proxy module. This
should work by default, and is fixed by adding capability sys_admin to
the apparmor profile.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/swtpm/+bug/2071478/+subscriptions
More information about the foundations-bugs
mailing list