selinux_conn_sid(9)
π selinux_conn_sid(9) π
okay bestie, welcome to the Kernel API Manual β¨ we're doing selinux_conn_sid today and honestly? she's giving "quiet little helper that does exactly one thing and does it well" energy. lowkey iconic. π
β¨ NAME β¨
selinux_conn_sid β determine the child socket label for a connection π§
like, you've got a socket, you've got a packet, and you want to know what label the brand-new baby connection socket should get. that's the whole vibe. π
π¦ SYNOPSIS π¦
int selinux_conn_sid (u32 sk_sid , u32 skb_sid , u32 *conn_sid );
three args, one int back, no cap. π«Ά
πΈ ARGUMENTS πΈ
sk_sidβ the parent socket's SID π the main character, the one who's spawning the connectionskb_sidβ the packet's SID π¦ the little messenger that showed up with infoconn_sidβ the resulting connection SID π this is where the answer goes, she's an out-param fr fr
β DESCRIPTION β
okay so here's the tea β
If skb_sid is valid, then the user:role:type information from sk_sid gets combined with the MLS information from skb_sid in order to create conn_sid. it's a little mashup, a lil collab, the two SIDs holding hands and making a third one π«±π»βπ«²π½β¨
If skb_sid is not valid, then conn_sid is simply a copy of sk_sid. no mixing, no drama, just a straight-up copy-paste situation π
returns zero on success, negative values on failure. so like,0= slay,< 0= something went wrong, go check it π
π₯ SEE ALSO π₯
the kernel file is ./security/selinux/hooks.c, and bestie there are so many siblings to meet:
selinux_secmark_enabled(9)selinux_peerlbl_enabled(9)task_avdcache_reset(9)task_avdcache_search(9)task_avdcache_update(9)selinux_inode_permission(9)selinux_inode_xattr_skipcap(9)selinux_mmap_backing_file(9)selinux_skb_peerlbl_sid(9)selinux_getselfattr(9)selinux_uring_override_creds(9)selinux_uring_sqpoll(9)selinux_uring_cmd(9)selinux_uring_allowed(9)
that's the whole group chat, go say hi ππ
mwah π that's the page! brought to you by ./security/selinux, dated October 2026, and yeah the page itself is literally named selinux_conn_sid(9) β she said "I'm the title AND the footer, consistency queen" πβ¨
π¦ 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