STRUCT LSM_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct lsm_info(9) πŸ’…

okay bestie, buckle UP β€” this is from the Kernel API Manual, section 9, and it's the literal blueprint for defining one single LSM inside the LSM framework. no cap, it's kind of a big deal. πŸŽ€


✨ NAME ✨

struct lsm_info β€” defines an individual LSM for the LSM framework. that's it, that's the whole vibe. one struct, one LSM, main character energy. πŸ‘‘


🌸 SYNOPSIS 🌸

struct lsm_info {
    const struct lsm_id *id;
    enum lsm_order order;
    unsigned long flags;
    struct lsm_blob_sizes *blobs;
    int *enabled;
    int (*init)(void);
    int (*initcall_pure)(void);
    int (*initcall_early)(void);
    int (*initcall_core)(void);
    int (*initcall_subsys)(void);
    int (*initcall_fs)(void);
    int (*initcall_device)(void);
    int (*initcall_late)(void);
    int (*initcall_late_sync)(void);
 };

like, look at her. fourteen members. absolutely iconic. πŸ¦‹


πŸ’– Members πŸ’–

  • id β€” the LSM's name/ID info. it's giving "who am I" but make it official. πŸͺͺ
  • order β€” where you sit in line compared to the other LSMs. optional ✨
  • flags β€” descriptive flags, just lil vibes describing stuff. optional ✨
  • blobs β€” LSM blob sharing. sharing is caring, bestie. optional ✨
  • enabled β€” controlled by CONFIG_LSM. the config is literally the parent here. optional ✨
  • init β€” the LSM specific initialization routine. the get-ready-with-me moment. 🌈
  • initcall_pure β€” LSM callback for initcall_pure setup. optional ✨
  • initcall_early β€” LSM callback for early_initcall setup. optional ✨
  • initcall_core β€” LSM callback for core_initcall setup. optional ✨
  • initcall_subsys β€” LSM callback for subsys_initcall setup. optional ✨
  • initcall_fs β€” LSM callback for fs_initcall setup. optional ✨
  • initcall_device β€” LSM callback for device_initcall setup. optional ✨
  • initcall_late β€” LSM callback for late_initcall setup. optional ✨
  • initcall_late_sync β€” LSM callback for late_initcall_sync setup. optional ✨
lowkey notice how almost everything except id and init is marked optional? yeah. that's the whole mood of this struct β€” bring what you need, leave the rest. 🫢

πŸ”₯ SEE ALSO πŸ”₯

go read those if you wanna understand the whole friend group, iykyk. πŸ’œ


and that's the page, babes! πŸŽ€ this lil masterpiece lives in ./include/linux, dated October 2026, and yes β€” it's struct lsm_info(9) all the way down. slay, stay safe, and don't forget your CONFIG_LSM. πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from