selinux_net...et_csk_clone(9)
β¨ NAME β¨
selinux_netlbl_inet_csk_clone β bestie, this one initializes the newly created sock π
Ok so real talk, we're kicking this off in the Kernel API Manual (that's the manual name, consider it folded in π), and the star of the show is selinux_netlbl_inet_csk_clone.
β¨ SYNOPSIS β¨
void selinux_netlbl_inet_csk_clone (struct sock *sk , u16 family );
That's it. That's the whole signature. Iconic, honestly. π¦
β¨ ARGUMENTS β¨
skβ the new sock 𧦠(yes, the new sock, that's literally what it is, no notes)familyβ the sock's address family π
β¨ DESCRIPTION β¨
So picture this: a new connection has been established using sk, right? And we've already labeled the socket via the request_sock struct in selinux_netlbl_inet_conn_request β like, that part is done, we ate that. π
But the way that we now have a sock structure means we still need to set the NetLabel state here. That's the whole assignment, that's the vibe check. π«Ά
Not me showing up late to the labeling party just because the struct type changed π β but fr fr, if you skip this, the NetLabel state doesn't get set, so, yeah. Do it.
β¨ SEE ALSO β¨
The kernel file in question: ./security/selinux/netlabel.c πΈ
And the whole friend group, no cap, every single one of them:
selinux_netlbl_sidlookup_cached(9)selinux_netlbl_sock_genattr(9)selinux_netlbl_sock_getattr(9)selinux_netlbl_cache_invalidate(9)selinux_netlbl_err(9)selinux_netlbl_sk_security_free(9)selinux_netlbl_sk_security_reset(9)selinux_netlbl_skbuff_getsid(9)selinux_netlbl_skbuff_setsid(9)selinux_netlbl_sctp_assoc_request(9)selinux_netlbl_inet_conn_request(9)selinux_netlbl_sctp_sk_clone(9)selinux_netlbl_socket_post_create(9)selinux_netlbl_sock_rcv_skb(9)selinux_netlbl_option(9)selinux_netlbl_socket_setsockopt(9)selinux_netlbl_socket_connect_helper(9)selinux_netlbl_socket_connect_locked(9)selinux_netlbl_socket_connect(9)
Sign-off time bestie π this little masterpiece lives in ./security/selinux and it's dated October 2026 β slay, go set that NetLabel state, periodt β¨
π¦ 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