landlock_add_rule(2) | System Calls Manual | landlock_add_rule(2) |
landlock_add_rule - add a new Landlock rule to a 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_add_rule, int ruleset_fd, enum landlock_rule_type rule_type, const void *rule_attr, uint32_t flags);
A Landlock rule describes an action on an object. An object is currently a file hierarchy, and the related filesystem actions are defined with a set of access rights. This landlock_add_rule() system call enables adding a new Landlock rule to an existing ruleset created with landlock_create_ruleset(2). See landlock(7) for a global overview.
ruleset_fd is a Landlock ruleset file descriptor obtained with landlock_create_ruleset(2).
rule_type identifies the structure type pointed to by rule_attr. Currently, Linux supports the following rule_type value:
struct landlock_path_beneath_attr { __u64 allowed_access; __s32 parent_fd; } __attribute__((packed));
flags must be 0.
On success, landlock_add_rule() returns 0.
landlock_add_rule() can fail for the following reasons:
Linux.
Linux 5.13.
See landlock(7).
landlock_create_ruleset(2), landlock_restrict_self(2), landlock(7)
2023-10-31 | Linux man-pages 6.7 |