security_lsmprop_to_secctx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to the security_lsmprop_to_secctx(9) page πŸ’– this one lives in the Kernel API Manual, and it's honestly a little underrated. grab a strawberry drink πŸ“ and let's get into it.


✨ NAME ✨

security_lsmprop_to_secctx β€” convert a lsm_prop to a secctx πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int security_lsmprop_to_secctx (struct lsm_prop *prop , struct
       lsm_context *cp , int lsmid );

🌸 ARGUMENTS 🌸

  • prop β€” the lsm specific information. it's giving "the actual data, bestie" πŸ’…
  • cp β€” the LSM context. this is where the glow-up lands ✨
  • lsmid β€” which security module to report. like, which LSM are we asking, fr fr πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

okay so the whole vibe of this function is: convert a prop entry to a security context. that's it, that's the plot 🫢

the key detail, no cap β€” if cp is NULL, the length of the result gets returned instead. and like… yes, that does mean the length could change between the call where you check the length and the next call that actually allocates and returns the cp. so don't be out here trusting that number from a million years ago 😭 it's a real caveat, not me being dramatic.

lsmid identifies which LSM should supply the context. a value of LSM_ID_UNDEF means the first LSM supplying the hook gets used β€” and that's the move in cases where the ID of the supplying LSM is unambiguous. icon behaviour, honestly πŸ‘‘


🌈 RETURN 🌈

returns the length of the data on success, or an error on failure. slay or flop, no in-between πŸ’€


πŸŽ€ SEE ALSO πŸŽ€

Kernel file ./security/security.c

and literally the entire extended universe of LSM friends, in order:


ok that's a lot of friends but every single one of them is here, i checked, don't @ me πŸ™ˆ

and that's the whole page bestie, you ate it up πŸ’… this little slice of the Kernel API Manual comes to you from the ./security source, dated October 2026 β€” mwah, go touch some grass (or some inodes) πŸ§šπŸ’œ

πŸ“¦ where this page comes from