security_netlbl_cache_add(9)
π 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms