include/uapi/linux/landlock.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/landlock.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/landlock.h- Extension
.h- Size
- 20921 bytes
- Lines
- 497
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.h
Detected Declarations
struct landlock_ruleset_attrstruct landlock_path_beneath_attrstruct landlock_net_port_attrenum landlock_rule_type
Annotated Snippet
struct landlock_ruleset_attr {
/**
* @handled_access_fs: Bitmask of handled filesystem actions
* (cf. `Filesystem flags`_).
*/
__u64 handled_access_fs;
/**
* @handled_access_net: Bitmask of handled network actions (cf. `Network
* flags`_).
*/
__u64 handled_access_net;
/**
* @scoped: Bitmask of scopes (cf. `Scope flags`_)
* restricting a Landlock domain from accessing outside
* resources (e.g. IPCs).
*/
__u64 scoped;
/**
* @quiet_access_fs: Bitmask of filesystem actions which should not be
* logged if per-object quiet flag is set.
*/
__u64 quiet_access_fs;
/**
* @quiet_access_net: Bitmask of network actions which should not be
* logged if per-object quiet flag is set.
*/
__u64 quiet_access_net;
/**
* @quiet_scoped: Bitmask of scoped actions which should not be logged.
*/
__u64 quiet_scoped;
};
/**
* DOC: landlock_create_ruleset_flags
*
* **Flags**
*
* %LANDLOCK_CREATE_RULESET_VERSION
* Get the highest supported Landlock ABI version (starting at 1).
*
* %LANDLOCK_CREATE_RULESET_ERRATA
* Get a bitmask of fixed issues for the current Landlock ABI version.
*/
/* clang-format off */
#define LANDLOCK_CREATE_RULESET_VERSION (1U << 0)
#define LANDLOCK_CREATE_RULESET_ERRATA (1U << 1)
/* clang-format on */
/**
* DOC: landlock_add_rule_flags
*
* **Flags**
*
* %LANDLOCK_ADD_RULE_QUIET
* Together with the quiet_* fields in struct landlock_ruleset_attr,
* this flag controls whether Landlock will log audit messages when
* access to the objects covered by this rule is denied by this layer.
*
* If logging is enabled, when Landlock denies an access, it will
* suppress the log if all of the following are true:
*
* - this layer is the innermost layer that denied the access;
* - all accesses denied by this layer are part of the quiet_* fields
* in the related struct landlock_ruleset_attr;
* - the object (or one of its parents, for filesystem rules) is
* marked as "quiet" via %LANDLOCK_ADD_RULE_QUIET.
*
* Because logging is only suppressed by a layer if the layer denies
* access, a sandboxed program cannot use this flag to "hide" access
* denials, without denying itself the access in the first place.
*
* The effect of this flag does not depend on the value of
* allowed_access in the passed in rule_attr. When this flag is
* present, the caller is also allowed to pass in an empty
* allowed_access.
*/
/* clang-format off */
#define LANDLOCK_ADD_RULE_QUIET (1U << 0)
/* clang-format on */
/**
* DOC: landlock_restrict_self_flags
*
* **Flags**
*
* By default, denied accesses originating from programs that sandbox themselves
* are logged via the audit subsystem. Such events typically indicate unexpected
* behavior, such as bugs or exploitation attempts. However, to avoid excessive
Annotation
- Immediate include surface: `linux/types.h`.
- Detected declarations: `struct landlock_ruleset_attr`, `struct landlock_path_beneath_attr`, `struct landlock_net_port_attr`, `enum landlock_rule_type`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.