security_net...cattr_to_sid(9)
β¨ security_netlbl_secattr_to_sid π
okay so this is a page from the Kernel API Manual bestie, and it's literally about turning NetLabel security attributes into a SELinux SID. tiny function, big main character energy. let's get into it π
πΈ NAME πΈ
security_netlbl_secattr_to_sid β converts a NetLabel secattr into a SELinux SID. that's it, that's the whole gig β¨
π¦ SYNOPSIS π¦
int security_netlbl_secattr_to_sid (struct netlbl_lsm_secattr *secattr ,
u32 *sid );
π ARGUMENTS π
secattrβ the NetLabel packet security attributes π like, this is the thing you're handing oversidβ the SELinux SID π
π DESCRIPTION π
so what it does: it takes the NetLabel security attributes chilling in secattr and converts them into a SELinux SID. that's the vibe. π
now here's the cute little detail β if the secattr field doesn't contain a full SELinux SID/context, then it uses SECINITSID_NETMSG as the foundation instead. like it's building on the base model, iykyk π§
and if it can, it lets the secattr be used by NetLabel to cache the secattr-to-SID conversion for future lookups. so it's not just doing the work, it's remembering the work. lowkey efficient π
returns zero on success, negative values on failure. classic. π
π₯ SEE ALSO π₯
go read these too, bestie, they're all in 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_cache_add(9)security_netlbl_sid_to_secattr(9)__security_read_policy(9)security_read_policy(9)security_read_state_kernel(9)
that's the whole page, no cap π«Ά this lil drop comes courtesy of ./security/selinux/ss and it's dated October 2026 β see you in the next one bestie, mwah ππΈ
π¦ 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