Question

Is my assumption true, that on Unix/Linux, the only way to GAIN root access is to execute a setuid-root file?

In other words, the system calls setuid(), setgid() are all about DROPPING privileges?

Please note that my question is not about exploits.

Was it helpful?

Solution

That's true. The only way for a non-root process (assuming it's running a non-setuid program) to become root is to exec a setuid program. If it's running a set-uid root program, then its effective uid is root and real uid is whoever ran it. It can then do setuid(0) to make its real uid 0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top