landlock_create_ruleset
create a new Landlock ruleset
- Provided by: manpages-dev (Version: 6.17-1)
- Source: manpages
- Report a bug
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 */ #include <unistd.h>
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 creates a new file descriptor which identifies 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;
__u64 handled_access_net;
};
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. On error, -1 is returned and errno is set to indicate the error.
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)