setreuid16() - sets real and effective user ids of the current process to given values
setreuid16() sets the real and effective user ids of the current process to the given values. It is the equivalent of setreuid(2) that uses 16 bit user identifiers, which is the same as the setuid(2) system call on 16 bit ids. This allows programs which use the 16 bit user identifiers to switch the user id of the current process. To change the user ids of another process use setreuid(2).
Edge cases: * If the effective user id is equal to the process's real user id and the effective user id is changed, then the saved set-user-ID of the executable will be set to the new effective user id. * If either of the new IDs matches the saved set-user-ID, then the saved set-user-ID will be cleared and the set-user-ID bit in the process's set of file mode creation flags will be cleared.
old_uid_t- real user ID.
old_uid_t- effective user ID.
- K - Originated from kernel-space.
- U - Originated from user space (for example, pointer to user space memory used to get it)
- TOCTOU - Vulnerable to TOCTOU (time of check, time of use)
- OPT - Optional argument - might not always be available (passed with null value)
In order to trace the setreuid16 system call execution for debugging purpose.
Example Use Case¶
setreuid16() can be used to switch the user id of the current process with the given real and effective user ids. This may be useful in situations where a process needs to gain extra privileges while still running under a different user.
Changing the user id of the process is a powerful action, and care needs to be taken to make sure that the effective user id is the same as the real user id. This is because if the effective user id is different from the real user id, then the saved set-user-ID of the executable will also be set to the effective user id.
setuid16(), seteuid16(), setfsuid16(), setreuid(), setuid(), seteuid(), setfsuid(), setresuid(), setresuid16(), chroot()
This document was automatically generated by OpenAI and needs review. It might not be accurate and might contain errors. The authors of Tracee recommend that the user reads the "events.go" source file to understand the events and their arguments better.