finit_module on x64
load a kernel module
sys_finit_module(int fd, const char *uargs, int flags)
| number | 313 (0x139) |
|---|---|
| abi | common |
| entry point | sys_finit_module |
| since | Linux 3.8 |
| man page | finit_module(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 313, the syscall number |
rdi | int fd |
rsi | const char *uargs |
rdx | int flags |
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 350
- arm64 273
- arm 379
- riscv64 273
- ia32 350
- x32 1073742137
- loongarch64 273
- ppc64 353
- ppc 353
- s390x 344
- mips64 5307
- mipsn32 6312
- mipso32 4348
- alpha 507
- arc 273
- blackfin 384, removed in 4.17
- cris 351, removed in 4.17
- csky 273
- hexagon 273
- ia64 1335, removed in 6.7
- m68k 348
- metag 273, removed in 4.17
- microblaze 380
- nds32 273, removed in 5.18
- nios2 273
- openrisc 273
- parisc 333
- score 273, removed in 4.17
- sh 368
- sparc 342
- sparc64 342
- tilegx 273, removed in 4.17
- tilepro 273, removed in 4.17
- xtensa 332
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/finit_module