init_module on x64
load a kernel module
sys_init_module(void *umod, unsigned long len, const char *uargs)
| number | 175 (0xaf) |
|---|---|
| abi | common |
| entry point | sys_init_module |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | init_module(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 175, the syscall number |
rdi | void *umod |
rsi | unsigned long len |
rdx | const char *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 128
- arm64 105
- arm 128
- riscv64 105
- ia32 128
- x32 1073741999
- loongarch64 105
- ppc64 128
- ppc 128
- s390x 128
- mips64 5168
- mipsn32 6168
- mipso32 4128
- alpha 307
- arc 105
- blackfin 128, removed in 4.17
- cris 128, removed in 4.17
- csky 105
- frv 128, removed in 4.17
- hexagon 105
- ia64 1133, removed in 6.7
- m32r 128, removed in 4.17
- m68k 128
- metag 105, removed in 4.17
- microblaze 128
- mn10300 128, removed in 4.17
- nds32 105, removed in 5.18
- nios2 105
- openrisc 105
- parisc 128
- score 105, removed in 4.17
- sh 128
- sparc 190
- sparc64 190
- tilegx 105, removed in 4.17
- tilepro 105, removed in 4.17
- xtensa 210
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/init_module