Sample Header Ad - 728x90

Why does setreuid have this limitation on setting ruid to current value of suid?

1 vote
0 answers
40 views
According to the [docs](https://man7.org/linux/man-pages/man2/setreuid.2.html) for setreuid: > Unprivileged processes may only set the effective user ID to the real user ID, the effective user ID, or the saved set-user-ID. > Unprivileged users may only set the real user ID to the real user ID or the effective user ID. Why can't we set our ruid to the suid directly? Given that we could first set our euid to the suid and _then_ set the ruid to our new euid, why are we prevented from doing this directly?
Asked by quixotrykd (359 rep)
Sep 27, 2023, 01:41 AM