selinux_conn_sid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 connection
  • skb_sid β€” the packet's SID πŸ“¦ the little messenger that showed up with info
  • conn_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:

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