]> git.ipfire.org Git - thirdparty/systemd.git/commit
nspawn: disconnect mounts propagation from host on our container dir
authorLennart Poettering <lennart@poettering.net>
Thu, 2 Mar 2023 17:28:37 +0000 (18:28 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 3 Mar 2023 11:17:42 +0000 (12:17 +0100)
commit75f8173247e7e5c50e1121c5330acf6f165a910d
treed8271b6cea1c9fa5487ad66d90ac4ab7a035e65f
parent11875a98e4f1c31e247d99e00c7774ea3653bafd
nspawn: disconnect mounts propagation from host on our container dir

@brauner noticed that in invoked containers the root directory is set to
still receive mounts from the host. We should disable that, and
guarantee we live in our own world, because that's what an
(nspawn-style) container *is* after all: a whole new world.

This hence mounts the container subtree to MS_PRIVATE after getting the
root dir in place. Note that this will later be set to MS_SHARED again.
The MS_PRIVATE disconnects mounts from the host, the MS_SHARED then
establishes a new peer group for mount propagation events, so that
payload service managers (such as systemd) can take benefit of
propagation further down the tree.
src/nspawn/nspawn.c