security_netlbl_cache_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– security_netlbl_cache_add β€” the Kernel API Manual, girlypop edition πŸ’–

okay so this one lives in the Kernel API Manual, section 9, and it's all about slipping an entry into the NetLabel cache. tiny function, big "i'm helping" energy. let's get into it 🫢


✨ NAME ✨

security_netlbl_cache_add β€” bestie, it literally Add an entry to the NetLabel cache. that's the whole job. no cap. πŸŽ€


🌸 SYNOPSIS 🌸

void security_netlbl_cache_add (struct netlbl_lsm_secattr *secattr , u32
sid );

she returns void (nothing back, just vibes) and takes two things. that's it. that's the whole signature πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • secattr β€” the NetLabel packet security attributes. this is the ✨payload✨ of the whole operation, iykyk.
  • sid β€” the SELinux SID. the main character of the argument list, honestly πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

okay so the actual lore: this function Attempts to cache the context in ctx, which was derived from the packet in skb, in the NetLabel subsystem cache. the way it just... tries. we respect the attempt πŸ’€

⚠️ important vibe check: this function assumes secattr has already been initialized. it does not do that for you. not me showing up to the function call without initializing my struct 😭 that's on you, bestie.

like genuinely, that's the whole caveat. initialize your secattr first or don't come crying to me. πŸ”₯


🌈 SEE ALSO 🌈

the whole friend group, fr fr β€” from the kernel file ./security/selinux/ss/services.c:

security_compute_av(9), security_sid_to_context(9), security_sid_to_context_inval(9), security_context_to_sid(9), security_context_to_sid_default(9), security_transition_sid(9), security_member_sid(9), security_change_sid(9), services_convert_context(9), security_load_policy(9), ocontext_to_sid(9), security_port_sid(9), security_ib_pkey_sid(9), security_ib_endport_sid(9), security_netif_sid(9), security_node_sid(9), __security_genfs_sid(9), security_genfs_sid(9), security_fs_use(9), security_net_peersid_resolve(9), security_policycap_supported(9), security_netlbl_secattr_to_sid(9), security_netlbl_sid_to_secattr(9), __security_read_policy(9), security_read_policy(9), security_read_state_kernel(9)

that's a lot of siblings and every single one of them is invited to the group chat πŸ’–βœ¨


aaaaand that's the page!! 🧚 sign-off time: this little icon comes to you courtesy of the source dir ./security/selinux/ss, dated October 2026, and the page itself is security_netlbl_cache_add(9). slay, go initialize your secattr πŸ’…πŸŽ€

πŸ“¦ where this page comes from