STRUCT LAYER_MASK(9)
π 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, noquietβ 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 withstruct layer_masks(9). onesis 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
- 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