Skip to content
Commit cae9910e authored by Felipe Gasper's avatar Felipe Gasper Committed by David S. Miller
Browse files

net: Add UNIX_DIAG_UID to Netlink UNIX socket diagnostics.



This adds the ability for Netlink to report a socket's UID along with the
other UNIX diagnostic information that is already available. This will
allow diagnostic tools greater insight into which users control which
socket.

To test this, do the following as a non-root user:

    unshare -U -r bash
    nc -l -U user.socket.$$ &

.. and verify from within that same session that Netlink UNIX socket
diagnostics report the socket's UID as 0. Also verify that Netlink UNIX
socket diagnostics report the socket's UID as the user's UID from an
unprivileged process in a different session. Verify the same from
a root process.

Signed-off-by: default avatarFelipe Gasper <felipe@felipegasper.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 54dee406
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment