selinux_net...ookup_cached(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, this one is selinux_netlbl_sidlookup_cached β€” and what it does is, like, it caches a SID lookup πŸ’… that's the whole vibe. it lives in the Kernel API Manual, which is exactly the kind of manual you'd expect a kernel function to be in, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

int selinux_netlbl_sidlookup_cached (struct sk_buff *skb , u16 family ,
struct netlbl_lsm_secattr *secattr , u32 *sid );

like literally just call it with those four things and it returns an int, slay ✨


🌸 ARGUMENTS 🌸

four arguments, four vibes, let's go:

  • skb β€” the packet πŸ¦‹ yes, that packet, the one we're talking about
  • family β€” the packet's address family
  • secattr β€” the NetLabel security attributes, iconic
  • sid β€” the SID πŸ‘‘

πŸ’– DESCRIPTION πŸ’–

so here's the tea: it queries the SELinux security server to look up the correct SID for the given security attributes. and if that query comes back successful, it caches the result so future lookups are faster β€” main character energy, honestly, doing the work once so nobody after you has to 😭

returns zero on success, and negative values on failure. that's it, that's the whole deal 🫢


🌈 SEE ALSO 🌈

the kernel file it lives in is ./security/selinux/netlabel.c β€” and honestly? the whole friend group is here, it's giving family reunion:


ngl, if you're reading this far, you're a real one πŸ’œ go read the source too, it's right there in ./security/selinux/netlabel.c.

and that's a wrap bestie!! this page came to you from ./security/selinux, dated October 2026 β€” mwah πŸ’‹ ✨ πŸŽ€ πŸ¦‹

πŸ“¦ where this page comes from