Why is chroot system call not available to non root user?
Solution 1:
If a non-privileged user could execute a setuid program in a chroot
jail, they could carefully construct that jail to trick the program into escalating privileges. For example, I can construct a chroot
jail in which I'm permitted to use sudo
, because I can control every configuration file inside that jail.