setfsgid on x64
set group identity used for filesystem checks
sys_setfsgid(gid_t gid)
| number | 123 (0x7b) |
|---|---|
| abi | common |
| entry point | sys_setfsgid |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | setfsgid(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 123, the syscall number |
rdi | gid_t gid |
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 139
- arm64 152
- arm 139
- riscv64 152
- ia32 139
- x32 1073741947
- loongarch64 152
- ppc64 139
- ppc 139
- s390x 216
- mips64 5121
- mipsn32 6121
- mipso32 4139
- alpha 326
- arc 152
- blackfin 139, removed in 4.17
- cris 139, removed in 4.17
- csky 152
- frv 139, removed in 4.17
- hexagon 152
- ia64 1143, removed in 6.7
- m68k 139
- metag 152, removed in 4.17
- microblaze 139
- mn10300 139, removed in 4.17
- nds32 152, removed in 5.18
- nios2 152
- openrisc 152
- parisc 139
- score 152, removed in 4.17
- sh 139
- sparc 229
- sparc64 229
- tilegx 152, removed in 4.17
- tilepro 152, removed in 4.17
- xtensa 181
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/setfsgid