selinux_net..._post_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– selinux_netlbl_socket_post_create(9) πŸ’–

okay so first thing bestie: this page lives in the Kernel API Manual, and the actual header up top literally prints it all squished like selinux_net..._post_create(9) β€” three whole times, in fact β€” because manpage name columns have ✨limits✨ and the kernel is not gonna fight that battle. the full name is selinux_netlbl_socket_post_create, iykyk, and it's section 9. let's get into it 🫢


πŸŽ€ NAME πŸŽ€

selinux_netlbl_socket_post_create β€” Label a socket using NetLabel

it's giving "one small job, done with love" πŸ’…

✨ SYNOPSIS ✨

int selinux_netlbl_socket_post_create (struct sock *sk , u16 family );

like, that's literally it. one function, two args, returns an int. clean. minimal. main character energy πŸ‘‘


🌸 ARGUMENTS 🌸

  • sk β€” the sock to label 🧦 (yes, the socket. it's the thing getting labeled, that's the whole vibe)
  • family β€” protocol family 🌈

πŸ¦‹ DESCRIPTION πŸ¦‹

so what it does is: it attempts to label a socket using the NetLabel mechanism using the given SID. that's the move. that's the whole move. πŸ’«

and then the returns, because we care about the returns:

  • zero values on success β€” slay, we ate, no notes ⭐
  • negative values on failure β€” 😭 not the negative values

no cap, that's the entire description. short and iconic. periodt.


πŸ”₯ SEE ALSO πŸ”₯

Kernel file: ./security/selinux/netlabel.c β€” go read the source bestie, it's right there πŸ“

and now the whole friend group, everybody say hi πŸ‘‹:

look at that roster 😭 every single one of them, we didn't skip a single bestie πŸ’œ


🌈 friendly reminder that this socket_post_create one is the post create one β€” the labeling happens after the create, and the success/failure return values are zero/negative respectively. remember the vibes and you'll remember the function ✨

and that's the page!! footer cuteness for the record books: this one comes from ./security/selinux, dated October 2026, and it signs off as selinux_net..._post_create(9) one last time because consistency is keys πŸ”‘πŸ’… bye bestie, go label some sockets πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from