setresuid on x64
set real, effective, and saved user or group ID
sys_setresuid(uid_t ruid, uid_t euid, uid_t suid)
| number | 117 (0x75) |
|---|---|
| abi | common |
| entry point | sys_setresuid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | setresuid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 117, the syscall number |
rdi | uid_t ruid |
rsi | uid_t euid |
rdx | uid_t suid |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 164
- arm64 147
- arm 164
- riscv64 147
- ia32 164
- x32 1073741941
- loongarch64 147
- ppc64 164
- ppc 164
- s390x 208
- mips64 5115
- mipsn32 6115
- mipso32 4185
- alpha 343
- arc 147
- blackfin 164, removed in 4.17
- cris 164, removed in 4.17
- csky 147
- frv 164, removed in 4.17
- hexagon 147
- ia64 1074, removed in 6.7
- m68k 164
- metag 147, removed in 4.17
- microblaze 164
- mn10300 164, removed in 4.17
- nds32 147, removed in 5.18
- nios2 147
- openrisc 147
- parisc 164
- score 147, removed in 4.17
- sh 164
- sparc64 108
- tilegx 147, removed in 4.17
- tilepro 147, removed in 4.17
- xtensa 144
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/setresuid