Unprivileged user namespace restrictions break various applications
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apparmor (Ubuntu) |
Fix Released
|
High
|
Alex Murray | ||
lxc (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When the unprivileged user namespace restrictions are enabled, various applications within and outside the Ubuntu archive fail to function, as they use unprivileged user namespaces as part of their normal operation.
A search of the Ubuntu archive for the 23.10 release was performed looking for all applications that make legitimate use of the CLONE_NEWUSER argument, the details of which can be seen in https:/
For each package identified in that list, an investigation was made to determine if the application actually used this as an unprivileged user, and if so which of the binaries within the package were affected.
The full investigation can be seen in https:/
For each of these binaries, an apparmor profile is required so that the binary can be granted use of unprivileged user namespaces - an example profile for the ch-run binary within the charliecloud package is shown:
$ cat /etc/apparmor.
abi <abi/4.0>,
include <tunables/global>
/usr/bin/ch-run flags=(unconfined) {
userns,
# Site-specific additions and overrides. See local/README for details.
include if exists <local/
}
However, in a few select cases, it has been decided not to ship an apparmor profile, since this would effectively allow this mitigation to be bypassed. In particular, the unshare and setns binaries within the util-linux package are installed on every Ubuntu system, and allow an unprivileged user the ability to launch an arbitrary application within a new user namespace. Any malicious application then that wished to exploit an unprivileged user namespace to conduct an attack on the kernel would simply need to spawn itself via `unshare -U` or similar to be granted this permission. Therefore, due to the ubiquitous nature of the unshare (and setns) binaries, profiles are not planned to be provided for these by default. Similarly, the bwrap binary within bubblewrap is also installed by default on Ubuntu Desktop 23.10 and can also be used to launch arbitrary binaries within a new user namespace and so no profile is planned to be provided for this either.
Those packages for which either a profile is not required or which a profile is not planned are listed below, whilst the list of packages that require a profile (and their associated binaries) is listed at the end:
Packages that use user namespaces but for which a profile is not required or not planned:
- bubblewrap
- /usr/bin/bwrap (NOT PLANNED AS NOTED ABOVE)
- cifs-utils
- /usr/sbin/
- consfigurator # NOT REQUIRED, NO BINARIES OR reverse-depends
- criu
- /usr/sbin/criu (NOT REQUIRED SINCE ONLY FUNCTIONS AS root)
- docker.io-app
- /usr/bin/dockerd (NOT REQUIRED SINCE RUNS AS root)
- firejail
- /usr/bin/firejail (NOT REQUIRED SINCE is suid root)
- golang-
- /usr/bin/
- golang-
- /usr/bin/runsc (NOT REQUIRED SINCE ONLY FUNCTIONS AS root)
- guix
- /usr/bin/
- libvdestack # NOT REQUIRED, NO BINARIES OR reverse-depends
- libvirt # NOT REQUIRED SINCE USES lxc WHICH WILL HAVE A PROFILE
- network-manager # NOT REQUIRED SINCE CODE IS UNUSED
- nix # APPEARS UNNEEDED IN DEFAULT CONFIGURATION
- ocaml-extunix # NO BINARIES OR reverse-depends
- passt
- /usr/bin/passt # IS EXPECTED TO BE EXECUTED AS root
- rust-rustix # NO BINARIES AND CODE IS UNUSED IN THE ARCHIVE
- util-linux
-
Packages that use unprivileged user namespaces which require a profile (or already have one as part of the previous apparmor update in 4.0.0~alpha2-
- bazel-bootstrap
- /usr/libexec/
- busybox
- /usr/bin/busybox
- charliecloud
- /usr/bin/ch-checkns (included in 4.0.0~alpha2-
- /usr/bin/ch-run (included in 4.0.0~alpha2-
- crun
- /usr/bin/crun (included in 4.0.0~alpha2-
- flatpak
- /usr/bin/flatpak
- golang-
- /usr/bin/buildah
- libcamera
- /usr/bin/cam
- /usr/bin/ipa_verify
- /usr/bin/
- /usr/bin/
- /usr/bin/qcam
- libpod
- /usr/bin/podman
- lxc
- /usr/bin/lxc-attach
- /usr/bin/lxc-create
- /usr/bin/
- /usr/bin/
- /usr/bin/lxc-start
- /usr/bin/lxc-stop
- /usr/bin/
- /usr/bin/
- mmdebstrap
- /usr/bin/mmdebstrap
- ocproxy
- /usr/bin/vpnns
- qt6-webengine
- /usr/lib/
- qtwebengine-
- /usr/lib/
- rootlesskit
- /usr/bin/
- rpm
- /usr/bin/rpm
- runc
- /usr/sbin/runc
The usage of CLONE_NEWUSER within the following packages were not able to be analysed fully and so profile are included for all relevant binaries:
- rust-virtiofsd
- /usr/libexec/
- sbuild
- /usr/bin/sbuild
- /usr/bin/
- /usr/bin/sbuild-apt
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/bin/
- /usr/sbin/
- /usr/sbin/
- slirp4netns
- /usr/bin/
- stress-ng
- /usr/bin/stress-ng
- systemd
- thunderbird
- /usr/bin/
- toybox
- /bin/toybox
- trinity
- /usr/bin/trinity
- tup
- /usr/bin/tup
- userbindmount
- /usr/bin/
- uwsgi
- /usr/bin/uwsgi-core
- vdens
- /usr/bin/vdens
Finally as noted in https:/
- google-chrome
- /opt/google/
Changed in apparmor (Ubuntu): | |
assignee: | nobody → Alex Murray (alexmurray) |
importance: | Undecided → High |
status: | New → Confirmed |
This bug was fixed in the package apparmor - 4.0.0~alpha2- 0ubuntu3
--------------- alpha2- 0ubuntu3) mantic; urgency=medium
apparmor (4.0.0~
* Add remaining AppArmor profiles to support unprivileged user unconfined- profiles. patch to add remaining apparmor. install multiarch. bazel.linux- sandbox lc-compliance lxc-usernsexec qt6.libexec. QtWebEngineProc ess multiarch. qt5.libexec. QtWebEngineProc ess virtiofsd sbuild- abort sbuild- checkpackages sbuild- clean sbuild- createchroot sbuild- distupgrade sbuild- shell sbuild- unhold sbuild- update sbuild- upgrade sbuild- adduser sbuild- destroychroot userbindmount chrome. chrome
namespace restrictions (LP: #2035315)
- Refreshed d/p/u/userns-
profiles and added to debian/
- usr.libexec.
- usr.bin.busybox
- usr.bin.buildah
- usr.bin.cam
- usr.bin.ipa_verify
- usr.bin.
- usr.bin.libcamerify
- usr.bin.qcam
- usr.bin.podman
- usr.bin.lxc-attach
- usr.bin.lxc-create
- usr.bin.lxc-destroy
- usr.bin.lxc-execute
- usr.bin.lxc-start
- usr.bin.lxc-stop
- usr.bin.lxc-unshare
- usr.bin.
- usr.bin.mmdebstrap
- usr.bin.vpnns
- usr.lib.
- usr.lib.
- usr.bin.rootlesskit
- usr.bin.rpm
- usr.sbin.runc
- usr.libexec.
- usr.bin.sbuild
- usr.bin.
- usr.bin.sbuild-apt
- usr.bin.
- usr.bin.
- usr.bin.
- usr.bin.
- usr.bin.sbuild-hold
- usr.bin.
- usr.bin.
- usr.bin.
- usr.bin.
- usr.sbin.
- usr.sbin.
- usr.bin.slirp4netns
- usr.bin.stress-ng
- usr.bin.thunderbird
- bin.toybox
- usr.bin.trinity
- usr.bin.tup
- usr.bin.
- usr.bin.uwsgi-core
- usr.bin.vdens
- opt.google.
-- Alex Murray <email address hidden> Thu, 14 Sep 2023 15:58:40 +0930