request_key on x64
request a key from the kernel's key management facility
sys_request_key(const char *_type, const char *_description, const char *_callout_info, key_serial_t destringid)
| number | 249 (0xf9) |
|---|---|
| abi | common |
| kconfig | CONFIG_KEYS |
| family | keys see the whole family on x64 |
| entry point | sys_request_key |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | request_key(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 249, the syscall number |
rdi | const char *_type |
rsi | const char *_description |
rdx | const char *_callout_info |
r10 | key_serial_t destringid |
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 287
- arm64 218
- arm 310
- riscv64 218
- ia32 287
- x32 1073742073
- loongarch64 218
- ppc64 270
- ppc 270
- s390x 279
- mips64 5240
- mipsn32 6244
- mipso32 4281
- alpha 440
- arc 218
- blackfin 287, removed in 4.17
- cris 287, removed in 4.17
- csky 218
- frv 287, removed in 4.17
- hexagon 218
- ia64 1272, removed in 6.7
- m32r 287, removed in 4.17
- m68k 280
- metag 218, removed in 4.17
- microblaze 287
- mn10300 287, removed in 4.17
- nds32 218, removed in 5.18
- nios2 218
- openrisc 218
- parisc 265
- score 218, removed in 4.17
- sh 286
- sparc 282
- sparc64 282
- tilegx 218, removed in 4.17
- tilepro 218, removed in 4.17
- xtensa 257
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/request_key