STRUCT LANDLOCK_RULES(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct landlock_rules(9) β€” from the Kernel API Manual, bestie πŸ’–

okay so this is a page from the Kernel API Manual, and it's literally all about struct landlock_rules β€” aka the red-black tree storage situation for Landlock rules. iykyk 🌳✨


🌸 NAME 🌸

struct landlock_rules β€” the red-black tree storage for Landlock rules, no cap. they hold the trees, that's the whole vibe 🫢


πŸŽ€ SYNOPSIS πŸŽ€

here's the struct verbatim, don't touch a single character bestie:

struct landlock_rules {
    struct rb_root root_inode;
  #if IS_ENABLED(CONFIG_INET);
    struct rb_root root_net_port;
  #endif ;
    u32 num_rules;
 };

πŸ¦‹ Members πŸ¦‹

  • root_inode β€” root of a red-black tree that's holding struct landlock_rule nodes with an inode object. and listen: it's immutable for domains. like, not changing. periodt πŸ”’
  • root_net_port β€” root of a red-black tree holding struct landlock_rule nodes with network port. also immutable for domains. same energy πŸ’…
  • num_rules β€” the number of non-overlapping rules in this tree storage (i.e. not for the same object). it's giving "count carefully" πŸ“Š

✨ Description ✨

so what does this thing actually do? it holds the rule trees that are shared by both rulesets and domains. that's it, that's the whole job β€” main character energy honestly πŸ‘‘


🌈 SEE ALSO 🌈

go look at the kernel file ./security/landlock/ruleset.h, plus all these iconic friends:

  • struct landlock_layer(9)
  • union landlock_key(9)
  • enum landlock_key_type(9)
  • struct landlock_id(9)
  • struct landlock_rule(9)
  • struct landlock_ruleset(9)
  • landlock_get_rule_root(9)

🧚 source lives at ./security/landlock, and this page is dated October 2026. mwah, go read the other landlock pages bestie πŸ’œπŸŽ€

struct landlock_rules(9) β€” that's a wrap, slay 🌸

πŸ“¦ where this page comes from