| Name |
Last commit
|
Last update |
|---|---|---|
| config | ||
| doc | ||
| scripts | ||
| src | ||
| test | ||
| .cvsignore | ||
| .gitignore | ||
| AUTHORS | ||
| CONTRIBUTING | ||
| COPYING | ||
| INSTALL | ||
| MAINTAINERS | ||
| Makefile.am | ||
| NEWS | ||
| README | ||
| RELEASE-NOTES | ||
| TODO | ||
| autogen.sh | ||
| configure.ac | ||
| lxc.pc.in | ||
| lxc.spec.in |
lxc currently does a chroot into the target rootfs. chroot is insecure and can easily be broken, as demonstrated here: | root@synergy:~# touch /this_is_the_realrootfs_ouch | # touch /container/webhost/this_is_the_container | # lxc-start -n webhost /bin/sh | # ls this* | this_is_the_container | # ./breakchroot | # ls this* | this_is_the_realrootfs_ouch code to break chroot taken from http://www.bpfh.net/simes/computing/chroot-break.html Now this can be fixed. As our container has his own mount namespace, we can easily pivot_root into the rootfs and then unmount all old mounts. The patch attached add a new config keyword which contains the path to a temporary mount for the old rootfs (inside the container). This stops the chroot break method shown before. Example: | root@synergy:~# grep pivotdir /var/lib/lxc/webhost/config | lxc.pivotdir = /oldrootfs | root@synergy:~# ls -lad /container/webhost/oldrootfs | drwxr-xr-x 2 root root 4096 2010-01-02 03:59 /container/webhost/oldrootfs | root@synergy:~# lxc-start -n webhost /bin/sh | # mount -t proc proc /proc | # cat /proc/mounts | rootfs / rootfs rw 0 0 | /dev/root / ext3 rw,relatime,errors=remount-ro,data=writeback 0 0 | devpts /dev/console devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 | proc /proc proc rw,relatime 0 0 | # ls this* | this_is_the_container | # ./breakchroot | # ls this* | this_is_the_container Signed-off-by:Daniel Lezcano <dlezcano@fr.ibm.com> Signed-off-by:
Michael Holtz <lxc@my.fqdn.org>
| Name |
Last commit
|
Last update |
|---|---|---|
| config | Loading commit data... | |
| doc | Loading commit data... | |
| scripts | Loading commit data... | |
| src | Loading commit data... | |
| test | Loading commit data... | |
| .cvsignore | Loading commit data... | |
| .gitignore | Loading commit data... | |
| AUTHORS | Loading commit data... | |
| CONTRIBUTING | Loading commit data... | |
| COPYING | Loading commit data... | |
| INSTALL | Loading commit data... | |
| MAINTAINERS | Loading commit data... | |
| Makefile.am | Loading commit data... | |
| NEWS | Loading commit data... | |
| README | Loading commit data... | |
| RELEASE-NOTES | Loading commit data... | |
| TODO | Loading commit data... | |
| autogen.sh | Loading commit data... | |
| configure.ac | Loading commit data... | |
| lxc.pc.in | Loading commit data... | |
| lxc.spec.in | Loading commit data... |