The chroot Technique – a Swiss army multitool for Linux systems
21–30 of 123 posts
Re: The chroot Technique – a Swiss army multitool for Linux systems
#22I actually wish that instead of docker & etc we had just gotten a better chroot... Or maybe just a new kernel syscall that is chroot()++.
unshare --mount
Most examples you'll find put it in the context of containers, like https://www.redhat.com/en/blog/mount-namespaces
Re: The chroot Technique – a Swiss army multitool for Linux systems
#23I actually wish that instead of docker & etc we had just gotten a better chroot... Or maybe just a new kernel syscall that is chroot()++.
Come to FreeBSD, we have just that - jails.
Re: The chroot Technique – a Swiss army multitool for Linux systems
#24If a system is screwed up enough, then a chroot strategy won't work because it relies on the path you are chrooting to to be generally valid and functional. If it's missing libraries you may well be screwed.
Re: The chroot Technique – a Swiss army multitool for Linux systems
#25I actually wish that instead of docker & etc we had just gotten a better chroot... Or maybe just a new kernel syscall that is chroot()++.
A linux-naive developer would expect to spawn a new process from a payload with access to nothing. It can't see other processes, it has a read only root with nothing in it, there are no network devices, no users, etc. Then they would expect to read documentation to learn how to add things to the sandbox. They want to pass in a directory, or a network interface, or some users. The effort goes into adding resources to the sandbox, not taking them away.
Instead there is this elaborate ceremony where the principal process basically spawns another version of itself endowed with all the same privileges and then gives them up, hopefully leaving itself with only the stuff it wants the sandboxed process to have. Make sure you don't forget to revoke anything.
Re: The chroot Technique – a Swiss army multitool for Linux systems
#26I actually wish that instead of docker & etc we had just gotten a better chroot... Or maybe just a new kernel syscall that is chroot()++.
Re: The chroot Technique – a Swiss army multitool for Linux systems
#27Re: The chroot Technique – a Swiss army multitool for Linux systems
#28Re: The chroot Technique – a Swiss army multitool for Linux systems
#29The arch linux install has a little wrapper around chroot, used to configure the installed system without booting it. https://wiki.archlinux.org/title/Installation_guide#Chroot
Gentoo’s stage3 would like to say a word