landlock_create_ruleset(2) | System Calls Manual | landlock_create_ruleset(2) |
landlock_create_ruleset - create a new Landlock ruleset
Standard C library (libc, -lc)
#include <linux/landlock.h> /* Definition of LANDLOCK_* constants */ #include <sys/syscall.h> /* Definition of SYS_* constants */
int syscall(SYS_landlock_create_ruleset, const struct landlock_ruleset_attr *attr, size_t size , uint32_t flags);
A Landlock ruleset identifies a set of rules (i.e., actions on objects). This landlock_create_ruleset() system call enables creating a new file descriptor identifying a ruleset. This file descriptor can then be used by landlock_add_rule(2) and landlock_restrict_self(2). See landlock(7) for a global overview.
attr specifies the properties of the new ruleset. It points to the following structure:
struct landlock_ruleset_attr { __u64 handled_access_fs; };
size must be specified as sizeof(struct landlock_ruleset_attr) for compatibility reasons.
flags must be 0 if attr is used. Otherwise, flags can be set to:
On success, landlock_create_ruleset() returns a new Landlock ruleset file descriptor, or a Landlock ABI version, according to flags.
landlock_create_ruleset() can fail for the following reasons:
Linux.
Linux 5.13.
See landlock(7).
landlock_add_rule(2), landlock_restrict_self(2), landlock(7)
2023-10-31 | Linux man-pages 6.7 |