security_unix_may_send(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… security_unix_may_send(9) β€” Kernel API Manual ✨

okay so bestie, welcome to the security_unix_may_send(9) page from the Kernel API Manual. This is the vibe check for whether an AF_UNIX socket can send datagrams. lowkey iconic, no cap. 🫢


🌸 NAME 🌸

security_unix_may_send β€” Check if AF_UNIX socket can send datagrams. πŸ’–

πŸŽ€ SYNOPSIS πŸŽ€

int security_unix_may_send (struct socket *sock , struct socket *other
       );

🫢 ARGUMENTS 🫢

  • sock β€” originating sock. The main character socket, fr fr.
  • other β€” peer sock. The buddy on the other side. πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

Check permissions before connecting or sending datagrams from sock to other. That's the assignment, and it ate. ✨

The unix_stream_connect and unix_may_send hooks were necessary because Linux provides an alternative to the conventional file name space for Unix domain sockets. That's the lore, ngl. πŸ“œ

Whereas binding and connecting to sockets in the file name space is mediated by the typical file permissions (and caught by the mknod and permission hooks in inode_security_ops), binding and connecting to sockets in the abstract name space is completely unmediated. Not me saying that's a whole vibe β€” it's literally the situation. 😭

Sufficient control of Unix domain sockets in the abstract name space isn't possible using only the socket layer hooks, since we need to know the actual target socket, which is not looked up until we are inside the af_unix code. That's the reason, periodt. πŸ’€

πŸ”₯ RETURN πŸ”₯

Returns 0 if permission is granted. So 0 is the green-light moment β€” slay. βœ…

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./security/security.c β€” and okay bestie, here's the whole SEE ALSO guest list, every name exactly as written, iykyk: πŸŽ€


xoxo, written in ./security, dated October 2026 β€” security_unix_may_send(9) out. πŸ’–βœ¨

πŸ“¦ where this page comes from