STRUCT NETLBL_LSM_SECATTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct netlbl_lsm_secattr(9) β€” the Kernel API Manual, bestie edition πŸŽ€

okay so this is the page for struct netlbl_lsm_secattr, aka the NetLabel LSM security attributes. it lives in the kernel API manual, and it's honestly kind of the main character of the NetLabel-to-LSM handoff. let's get into it ✨


🌸 SYNOPSIS 🌸

here's the whole struct, bestie β€” every field, every define, copied exactly so you can paste it straight into your notes:

struct netlbl_lsm_secattr {
    u32 flags;
  #define NETLBL_SECATTR_NONE             0x00000000;
  #define NETLBL_SECATTR_DOMAIN           0x00000001;
  #define NETLBL_SECATTR_DOMAIN_CPY       (NETLBL_SECATTR_DOMAIN |
NETLBL_SECATTR_FREE_DOMAIN);
  #define NETLBL_SECATTR_CACHE            0x00000002;
  #define NETLBL_SECATTR_MLS_LVL          0x00000004;
  #define NETLBL_SECATTR_MLS_CAT          0x00000008;
  #define NETLBL_SECATTR_SECID            0x00000010;
  #define NETLBL_SECATTR_FREE_DOMAIN      0x01000000;
  #define NETLBL_SECATTR_CACHEABLE        (NETLBL_SECATTR_MLS_LVL |
NETLBL_SECATTR_MLS_CAT |
NETLBL_SECATTR_SECID);
    u32 type;
    char *domain;
    struct netlbl_lsm_cache *cache;
    struct {
      struct {
        struct netlbl_lsm_catmap *cat;
        u32 lvl;
      } mls;
      u32 secid;
    } attr;
 };

like… look at her. nested structs, bit flags, a whole little mls situation inside attr. it's giving organized chaos and we respect it πŸ’…


✨ Members ✨

  • flags β€” tells you which parts of the struct are actually valid, see the NETLBL_SECATTR_* defines. it's the vibe check for the rest of the fields 🫢
  • type β€” the NLTYPE of the attributes. yes, which kind of attributes.
  • domain β€” the NetLabel LSM domain. this is the "who are you and what's your config" field πŸ¦‹
  • cache β€” NetLabel LSM specific cache. little reusable goodie bag.
  • attr.mls β€” the MLS sensitivity label 🌈
  • attr.mls.cat β€” MLS category bitmap. it's a bitmap, it's categorizing, it's doing the most.
  • attr.mls.lvl β€” MLS sensitivity level. the level, the elevation, the altitude πŸ”₯
  • attr.secid β€” LSM specific secid token. hand it over and let the LSM cook.

πŸ‘‘ Description πŸ‘‘

so this struct is literally the messenger πŸ’Œ β€” it's how security attributes get passed between NetLabel and the LSM modules.

the flags field is the one doing the gatekeeping: it specifies which fields within the struct are valid, and you build your valid values by bitwise OR'ing the NETLBL_SECATTR_* defines together. so like, NETLBL_SECATTR_MLS_LVL | NETLBL_SECATTR_MLS_CAT β€” that kind of moment ✨

and the domain field is typically set by the LSM to specify domain specific configuration settings β€” and here's the tea β˜• β€” it's not usually used by NetLabel itself when returning security attributes to the LSM. so bestie, know whose field it is before you go touching it πŸ™ˆ


🧚 SEE ALSO 🧚

Kernel file ./include/net/netlabel.h, plus all these icons:


ok that's the whole page, no cap, nothing skipped πŸ’€ go forth and pass those security attributes responsibly, bestie πŸ“

and that's a wrap from ./include/net β€” October 2026 era, struct netlbl_lsm_secattr(9) energy all the way. slay, periodt πŸ’œ

πŸ“¦ where this page comes from