STRUCT LANDLOCK_RULESET(9)
π struct landlock_ruleset(9) β the Kernel API Manual, bestie edition β¨
okay so this is a page from the Kernel API Manual, and the star of the show is struct landlock_ruleset β literally the blueprint for a Landlock ruleset. she's iconic, she's structured, and she's about to make so much sense. π
β¨ NAME β¨
struct landlock_ruleset β Landlock ruleset. that's it, that's the name, slay. π
π¦ SYNOPSIS π¦
here's the whole vibe, character for character, no cap:
struct landlock_ruleset {
struct landlock_rules rules;
struct mutex lock;
refcount_t usage;
#ifdef CONFIG_TRACEPOINTS;
u64 version;
u64 id;
#endif ;
struct access_masks quiet_masks;
struct access_masks handled_masks;
};
πΈ Members πΈ
bestie these are the fields, and every single one matters:
rulesβ the red-black tree storage for rules. that's where the rules live, periodt. π³lockβ protects against concurrent modifications ofrules, ifusageis greater than zero. she's the bodyguard fr fr. πͺusageβ the number of file descriptors referencing this ruleset. like a little headcount for who's holding a ref. π«Άversionβ a counter that gets incremented on each successfullandlock_add_rule(2), including when it only extends an existing rule's access rights. tracepoints use it to correlate a domain with the exact successful rule history it was created from. protected bylock. the way she just keeps receipts πβidβ a unique identifier for this ruleset, used for tracing. main character energy, obviously unique. π¦quiet_masksβ stores the quiet flags for an unmerged ruleset. for a merged domain, this is stored in each layer'sstruct landlock_hierarchyinstead. not me relocating the data, iykyk πhandled_masksβ contains the subset of filesystem and network actions that are handled by this ruleset. the whole "what are we even managing here" energy. π
π§ Description π§
so here's the tea: this data structure must contain unique entries, be updatable, and quick to match an object. that's the whole assignment, and she ate. β¨π₯
π SEE ALSO π
the whole bestie squad, go check them out:
- Kernel file
./security/landlock/ruleset.h struct landlock_layer(9)union landlock_key(9)enum landlock_key_type(9)struct landlock_id(9)struct landlock_rule(9)struct landlock_rules(9)landlock_get_rule_root(9)
ngl, this page lives in ./security/landlock and it's dated October 2026 β so like, future vibes only. see u in the source tree, bestie ππ
kisses, and happy rule-matching ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms