selinux_netl...t_setsockopt(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… selinux_netlbl_socket_setsockopt(9) πŸ’…

okay so welcome to the Kernel API Manual, bestie β€” today’s main character is the page selinux_netl...t_setsockopt(9), and the function underneath is selinux_netlbl_socket_setsockopt. The header is out here doing its little truncated-name moment, but we move. ✨


🌸 NAME 🌸

selinux_netlbl_socket_setsockopt β€” do not allow users to remove a NetLabel. That’s literally the whole vibe.


✨ SYNOPSIS ✨

int selinux_netlbl_socket_setsockopt (struct socket *sock , int level ,
       int optname );

🫢 ARGUMENTS 🫢

  • sock β€” the socket.
  • level β€” the socket level or protocol.
  • optname β€” the socket option name.

πŸ’… DESCRIPTION πŸ’…

okay so this one checks the setsockopt call. If the user is trying to replace the IP options on a socket and a NetLabel is in place for the socket, it denies the access; otherwise it allows the access.

It returns zero when the access is allowed, -EACCES when denied, and other negative values on error. no cap, that’s the whole return situation. 🫢


πŸ”₯ SEE ALSO πŸ”₯

Kernel file: ./security/selinux/netlabel.c


okay that’s the whole page, bestie πŸŽ€ this one’s from ./security/selinux, dated October 2026, and the footer is out here repping selinux_netl...t_setsockopt(9). slay, go read the kernel file, mwah πŸ’‹

πŸ“¦ where this page comes from