smk_set_access(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… smk_set_access(9) β€” Kernel API Manual, bestie edition πŸŽ€

okay so picture this: it's smk_set_access, a function from the Kernel API Manual, and she is literally the rule-list glow-up specialist. here's everything you need to know, no cap. ✨


✨ SYNOPSIS ✨

int smk_set_access (struct smack_parsed_rule *srp , struct list_head
*rule_list , struct mutex *rule_lock );

that's the whole vibe. three args, one int coming back at you. 🫢


🌸 ARGUMENTS 🌸

  • srp β€” the rule we're adding or replacing. this is the girl. the main character of the operation πŸ’…
  • rule_list β€” the list of rules. yes, the list. the one she's about to be in.
  • rule_lock β€” the rule list lock. mutual exclusion said what she said. πŸ”’

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? bestie, listen πŸ‘‘

she goes looking through the current subject/object/access list for the subject/object pair. if she finds that pair? she replaces the access that was already chilling there. if the pair isn't found? she just adds it, with the access you specified. iconic behaviour, honestly. no drama, just rules. ✨

return value tea β˜•:

  • returns 0 if nothing goes wrong β€” slay, we love a clean run πŸŽ€
  • returns -ENOMEM if it fails during the allocation of the new pair to add β€” the memory said "not today" πŸ˜­πŸ’€
ngl, that -ENOMEM is the only plot twist here. everything else is smooth sailing. 🌈

πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./security/smack/smackfs.c, plus a whole friend group of functions β€” all of them, i'm not skipping a single one, that would be so rude:

like i said β€” everyone's here. the whole smack squad. πŸ’œ


and that's the page, bestie 🧚 this little number lives under ./security/smack, dated October 2026, and goes by smk_set_access(9) β€” go forth and set some access, periodt. πŸ’–

πŸ“¦ where this page comes from