landlock_restrict_self on x64
enforce a Landlock ruleset
sys_landlock_restrict_self(int ruleset_fd, __u32 flags)
| number | 446 (0x1be) |
|---|---|
| abi | common |
| kconfig | CONFIG_SECURITY_LANDLOCK |
| family | landlock see the whole family on x64 |
| entry point | sys_landlock_restrict_self |
| since | Linux 5.13 |
| man page | landlock_restrict_self(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 446, the syscall number |
rdi | int ruleset_fd |
rsi | __u32 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 446
- arm64 446
- arm 446
- riscv64 446
- ia32 446
- x32 1073742270
- loongarch64 446
- ppc64 446
- ppc 446
- s390x 446
- mips64 5446
- mipsn32 6446
- mipso32 4446
- alpha 556
- arc 446
- csky 446
- hexagon 446
- ia64 1470, removed in 6.7
- m68k 446
- microblaze 446
- nds32 446, removed in 5.18
- nios2 446
- openrisc 446
- parisc 446
- sh 446
- sparc 446
- sparc64 446
- xtensa 446
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/landlock_restrict_self