STRUCT NETLBL_LSM_SECATTR(9)
π 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 theNETLBL_SECATTR_*defines. it's the vibe check for the rest of the fields π«Άtypeβ theNLTYPEof 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:
struct netlbl_lsm_cache(9)struct netlbl_calipso_ops(9)netlbl_secattr_cache_alloc(9)netlbl_secattr_cache_free(9)netlbl_catmap_alloc(9)netlbl_catmap_free(9)netlbl_secattr_init(9)netlbl_secattr_destroy(9)netlbl_secattr_alloc(9)netlbl_secattr_free(9)
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
- 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