News for hackers. Stuff that matters.
Re:PRoot: User-space implementation of chroot, mount –bind, ... by vifon on Thursday November 28, 2024 @08:22AM (#42265066)
chroot doesn't nest, there is only one chroot active for a given process at a given moment. If you're inside a chrooted environment and call chroot on a subdirectory without entering it, you regain the access to the parent directories.
Re:PRoot: User-space implementation of chroot, mount –bind, ... by compsciphd on Thursday November 28, 2024 @02:48PM (#42268083)
which is why before fs namespaces, as part of security research prototype work I did, I created a "chroot aware" (not quite, but close enough for this context to use that term), that wouldn't let one walk past certain directories (i.e. lookup() would fail for them, no matter what permissions the user had once one entered "pseudo namespace" mode via this chroot mechanism). Was very easy to accomplish, but also very much a hack that fs namespaces are much better for.