]> git.ipfire.org Git - thirdparty/lxc.git/commit
Set all mounts to MS_SLAVE when starting a container without a rootfs
authorDavid Ward <david.ward@ll.mit.edu>
Wed, 27 Mar 2013 01:27:52 +0000 (21:27 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 27 Mar 2013 13:20:50 +0000 (09:20 -0400)
commita0f379bfec4e341763ba7ed0099ce9cabaccd7c5
tree8cbbda9669ae5264d0c4a4c97ecf6749c1d0c620
parent8a63c0a9d9089e6365e5a696455476febed39d6a
Set all mounts to MS_SLAVE when starting a container without a rootfs

If the filesystem mounts on the host have the MS_SHARED or MS_SLAVE
flag set, and a container without a rootfs is started, then any new
mounts created inside the container are currently propagated into
the host. In addition to mounts placed in the configuration file of
the container or performed manually after startup, the automatic
mounting of /proc by lxc-execute will propagate back into the host,
effectively crippling the entire system. This can be prevented by
setting the MS_SLAVE flag on all mounts (inside the container's own
mount namespace) during startup if a rootfs is not configured.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c