]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc: don't call pivot_root if / is on a ramfs
authorAndrey Vagin <avagin@gmail.com>
Sat, 4 Oct 2014 21:49:16 +0000 (01:49 +0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 8 Oct 2014 16:24:52 +0000 (11:24 -0500)
commit91e93c71c7487bce07eada582397af1104d64a8e
treec17c36edf1111e85bd1fc9feccc66afd9c0937ea
parent956f113bf0c3b8e8d686afd912ba24080a121d7d
lxc: don't call pivot_root if / is on a ramfs

pivot_root can't be called if / is on a ramfs. Currently chroot is
called before pivot_root. In this case the standard well-known
'chroot escape' technique allows to escape a container.

I think the best way to handle this situation is to make following actions:
* clean all mounts, which should not be visible in CT
* move CT's rootfs into /
* make chroot into /

I don't have a host, where / is on a ramfs, so I can't test this patch.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/conf.c