Unix Domain Sockets

📚 unix(7)

Unix Domain Sockets are an IPC mechanism on Unix that works through the BSD socket API.

In the context of LandlockLsm, Unix Domain Sockets are notable because they can be used to pass file descriptors between processes.

The sockaddr struct for Unix Domain sockets is (from unix(7)):

struct sockaddr_un {
    sa_family_t sun_family;               /* AF_UNIX */
    char        sun_path[108];            /* Pathname */
};

Unix Domain Sockets can be created in two ways: