landlock_create_ruleset on x64

create a new Landlock ruleset

sys_landlock_create_ruleset(const struct landlock_ruleset_attr *attr, size_t size, __u32 flags)
number444 (0x1bc)
abicommon
kconfigCONFIG_SECURITY_LANDLOCK
familylandlock see the whole family on x64
entry pointsys_landlock_create_ruleset
sinceLinux 5.13
man pagelandlock_create_ruleset(2)
sourceelixir.bootlin.com

Registers

registervalue
rax444, the syscall number
rdiconst struct landlock_ruleset_attr *attr
rsisize_t size
rdx__u32 flags
raxthe 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

Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/landlock_create_ruleset