capget on x64
set/get capabilities of thread(s)
sys_capget(cap_user_header_t header, cap_user_data_t dataptr)
| number | 125 (0x7d) |
|---|---|
| abi | common |
| entry point | sys_capget |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | capget(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 125, the syscall number |
rdi | cap_user_header_t header |
rsi | cap_user_data_t dataptr |
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 184
- arm64 90
- arm 184
- riscv64 90
- ia32 184
- x32 1073741949
- loongarch64 90
- ppc64 183
- ppc 183
- s390x 184
- mips64 5123
- mipsn32 6123
- mipso32 4204
- alpha 368
- arc 90
- blackfin 184, removed in 4.17
- cris 184, removed in 4.17
- csky 90
- frv 184, removed in 4.17
- hexagon 90
- ia64 1185, removed in 6.7
- m32r 184, removed in 4.17
- m68k 184
- metag 90, removed in 4.17
- microblaze 184
- mn10300 184, removed in 4.17
- nds32 90, removed in 5.18
- nios2 90
- openrisc 90
- parisc 106
- score 90, removed in 4.17
- sh 184
- sparc 21
- sparc64 21
- tilegx 90, removed in 4.17
- tilepro 90, removed in 4.17
- xtensa 158
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/capget