vfork on x64
create a child process and block parent
sys_vfork(void)
| number | 58 (0x3a) |
|---|---|
| abi | common |
| entry point | sys_vfork |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | vfork(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 58, the syscall number |
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 190
- arm 190
- ia32 190
- x32 1073741882
- ppc64 189
- ppc 189
- s390x 190
- alpha 66
- blackfin 190, removed in 4.17
- cris 190, removed in 4.17
- frv 190, removed in 4.17
- m32r 190, removed in 4.17
- m68k 190
- microblaze 190
- mn10300 190, removed in 4.17
- parisc 113
- score 1071, removed in 4.17
- sh 190
- sparc 66
- sparc64 66
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/vfork