STRUCT LAYER_MASK(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct layer_mask(9) β€” the Kernel API Manual, but make it make sense

okay so bestie, buckle up, because this is a page about struct layer_mask from the kernel API manual (section 9, iykyk), and it's literally the access rights + rule flags for a layer. that's the whole vibe. let's get into it πŸŽ€


✨ NAME ✨

struct layer_mask β€” the access rights and rule flags for a layer. yes, that's the entire name section and yes it ate πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the struct in all its glory, character for character, no notes:

struct layer_mask {
    access_mask_t access : LANDLOCK_NUM_ACCESS_MAX;
  #ifdef CONFIG_SECURITY_LANDLOCK_LOG;
    access_mask_t quiet : 1;
  #endif ;
    access_mask_t __pad : _LANDLOCK_LAYER_MASK_PADDING;
 };

like... look at those bitfields. the compiler said "we're doing bits today" and honestly? iconic ✨


🌸 Members 🌸

  • access β€” the unfulfilled access rights for this layer. think of it as the to-do list of permissions that haven't been granted yet, bestie πŸ“
  • quiet β€” whether we've encountered a rule with the quiet flag for this layer. it's used to control logging, so it's basically the "shh, no talking" switch 🀫 (and reminder: it lives inside #ifdef CONFIG_SECURITY_LANDLOCK_LOG, so no config, no quiet β€” periodt)
  • __pad β€” padding for the compiler's bitfield initialization. it's the structural equivalent of a decorative cushion: not doing much, but the compiler needs it πŸ›‹οΈ

🧚 Description 🧚

okay so this struct has a bit for each access rights and rule flags, fr fr πŸ’–

during access checks, it's used to represent the access rights for each layer which still need to be fulfilled. so picture the main character of an access check holding a little checklist per layer, and layer_mask is that checklist 🌈

and here's the satisfying part: when all bits are 0, the access request is considered to be fulfilled. all zeros = vibes immaculate, request granted, confetti πŸŽ‰πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./security/landlock/access.h
  • struct layer_masks(9)

(notice the s, bestie β€” that's layer_masks, plural. do not come for me, I'm just the messenger 😭)


lowkey important: don't mix this up with struct layer_masks(9). one s is a whole different struct and that's just how it is πŸ’€

and that's the page! 🫢 this one came from ./security/landlock and it's dated October 2026 β€” so like, future vibes only β­πŸ’œ mwah, study your bitfields, ily, bye πŸŽ€

πŸ“¦ where this page comes from