I was reading description about setuid on wikipedia
http://en.wikipedia.org/wiki/Setuid
I was unable to understand how chroot is related to setuid as mention in following paragraph from wikipedia
The presence of setuid executables explains why the chroot system call
is not available to non-root users on Unix. See limitations of chroot
for more details.
Best Answer
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 achroot
jail in which I'm permitted to usesudo
, because I can control every configuration file inside that jail.