diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-11-08 12:15:16 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2025-01-23 21:48:02 +0100 |
commit | d6f8e1ae879ed1676406b61b6f4dba1bdd3749ae (patch) | |
tree | 03e2b6afd2914a765f73ff76abc0065cae0f3dec /units/systemd-mountfsd.service.in | |
parent | docs: mention the two other userdb services we ship these days (diff) | |
download | systemd-d6f8e1ae879ed1676406b61b6f4dba1bdd3749ae.tar.xz systemd-d6f8e1ae879ed1676406b61b6f4dba1bdd3749ae.zip |
mntfsd: add api to mount dirs for containers
systemd-mountfsd so far provided a MountImage() API call for mounting a
disk image and returning a set of mount fds. This complements the API
with a new MountDirectory() API call, that operates on a directory
instead of an image file. Now, what makes this interesting is that it
applies an idmapping from the foreign UID range to the provided target
userns – and in which case unpriveleged operation is allowed (well,
under some conditions: in particular the client must own a parent dir of
the provided path).
This allows container managers to run fully unprivileged from
directories – as long as those directories are owned by the foreign UID
range. Basic operation is like this:
1. acquire a transient userns from systemd-nsresourced with 64K users
2. ask systemd-mountfsd for an idmapped mount of the container dir
matching that userns
3. join the userns and bind the mount fd as root.
Note that we have to drop various sandboxing knobs from the mountfsd
service file for this to work, since the kernel's security checks that
try to ensure than an obstructed /proc/ cannot be circumvented via
mounting a new procfs will otherwise prohibit mountfsd to duplicate the
mounts properly.
Diffstat (limited to '')
-rw-r--r-- | units/systemd-mountfsd.service.in | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/units/systemd-mountfsd.service.in b/units/systemd-mountfsd.service.in index ef413684c3..00a0827fbc 100644 --- a/units/systemd-mountfsd.service.in +++ b/units/systemd-mountfsd.service.in @@ -25,13 +25,7 @@ LimitNOFILE={{HIGH_RLIMIT_NOFILE}} LockPersonality=yes MemoryDenyWriteExecute=yes NoNewPrivileges=yes -ProtectProc=invisible -ProtectControlGroups=yes -ProtectHome=yes ProtectHostname=yes -ProtectKernelLogs=yes -ProtectKernelModules=yes -ProtectSystem=strict RestrictAddressFamilies=AF_UNIX AF_NETLINK AF_INET AF_INET6 RestrictRealtime=yes RestrictSUIDSGID=yes |