smk_access_entry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… smk_access_entry(9) β€” or, the Kernel API Manual's cutest little lookup function πŸŽ€

okay so bestie, gather round, because this one lives in the Kernel API Manual and it's literally the function that goes "hmm, do you two know each other?" about labels. let's get into it ✨


🌸 NAME 🌸

smk_access_entry β€” look up matching access rule πŸ”


πŸ¦‹ SYNOPSIS πŸ¦‹

int smk_access_entry (char *subject_label , char *object_label , struct
list_head *rule_list );

like, that's the whole vibe. three args in, an int out. periodt πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • subject_label β€” a pointer to the subject's Smack label πŸ‘‘ (yes, the subject, the one doing the doing)
  • object_label β€” a pointer to the object's Smack label πŸ“ (the thing being done to, we love a supportive object)
  • rule_list β€” the list of rules to search πŸ“œ like, the actual guest list you're checking

✨ DESCRIPTION ✨

so basically? this function looks up the subject/object pair in the access rule list and returns the access mode. that's it, that's the whole job, and she does it flawlessly πŸ’–

and if no entry is found? it returns -ENOENT. 😭 no entry, no vibes, no access.


πŸ’€ NOTE πŸ’€

okay this part is the lore drop, pay attention bestie:

Earlier versions of this function allowed for labels that were not on the label list. this was done to allow for labels to come over the network that had never been seen before on this host 🌐 like, mystery labels showing up unannounced, no cap.

Unless the receiving socket has the star label, this will always result in a failure check. ⭐ the star labeled socket case is now handled in the networking hooks, so there is no case where the label is not on the label list. glow-up achieved ✨

Checking to see if the address of two labels is the same is now a reliable test. πŸ”₯ fr fr, you can trust it now.

Do the object check first because that is more likely to differ. πŸ‘€ iconic optimization advice, honestly.
Allowing write access implies allowing locking. πŸ”’βœοΈ write girlies get lock privileges too, that's just how it is.

🌈 SEE ALSO 🌈

Kernel file ./security/smack/smack_access.c and the whole friend group:


and that's the page, bestie 🫢 this lil icon comes to you straight from ./security/smack, dated October 2026 β€” so yeah, she's fresh, she's secure, she's giving main character energy in the Smack subsystem πŸ§šβ€β™€οΈπŸ’œ mwah πŸ’‹

πŸ“¦ where this page comes from