landlock_add_rule on x64
add a new Landlock rule to a ruleset
sys_landlock_add_rule(int ruleset_fd, enum landlock_rule_type rule_type, const void *rule_attr, __u32 flags)
| number | 445 (0x1bd) |
|---|---|
| abi | common |
| kconfig | CONFIG_SECURITY_LANDLOCK |
| family | landlock see the whole family on x64 |
| entry point | sys_landlock_add_rule |
| since | Linux 5.13 |
| man page | landlock_add_rule(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 445, the syscall number |
rdi | int ruleset_fd |
rsi | enum landlock_rule_type rule_type |
rdx | const void *rule_attr |
r10 | __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 445
- arm64 445
- arm 445
- riscv64 445
- ia32 445
- x32 1073742269
- loongarch64 445
- ppc64 445
- ppc 445
- s390x 445
- mips64 5445
- mipsn32 6445
- mipso32 4445
- alpha 555
- arc 445
- csky 445
- hexagon 445
- ia64 1469, removed in 6.7
- m68k 445
- microblaze 445
- nds32 445, removed in 5.18
- nios2 445
- openrisc 445
- parisc 445
- sh 445
- sparc 445
- sparc64 445
- xtensa 445
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/landlock_add_rule