seccomp on x64
operate on Secure Computing state of the process
sys_seccomp(unsigned int op, unsigned int flags, void *uargs)
| number | 317 (0x13d) |
|---|---|
| abi | common |
| kconfig | CONFIG_SECCOMP |
| entry point | sys_seccomp |
| since | Linux 3.17 |
| man page | seccomp(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 317, the syscall number |
rdi | unsigned int op |
rsi | unsigned int flags |
rdx | void *uargs |
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 354
- arm64 277
- arm 383
- riscv64 277
- ia32 354
- x32 1073742141
- loongarch64 277
- ppc64 358
- ppc 358
- s390x 348
- mips64 5312
- mipsn32 6316
- mipso32 4352
- alpha 514
- arc 277
- blackfin 388, removed in 4.17
- cris 355, removed in 4.17
- csky 277
- hexagon 277
- ia64 1353, removed in 6.7
- m68k 380
- metag 277, removed in 4.17
- microblaze 384
- nds32 277, removed in 5.18
- nios2 277
- openrisc 277
- parisc 338
- score 277, removed in 4.17
- sh 372
- sparc 346
- sparc64 346
- tilegx 277, removed in 4.17
- tilepro 277, removed in 4.17
- xtensa 337
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/seccomp