Skip to content

unix: Introduce /proc/net/unix_peers file

Pavel Emelyanov netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2unix: Reformat proc files creationnet/unix/af_unix.c+27 -70 replies
2/2unix: Add /proc/net/unix_peers filenet/unix/af_unix.c+55 -03 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] unix: Introduce /proc/net/unix_peers file

Hi.

There's a common problem with unix sockets -- there's no way to determine which tasks are connected to each other with a unix socket. Although the /proc/<pid>/fd/<n> symlink shows a socket inode number, the peers do not share an inode and thus these numbers give no answer.

There have been an attempt last year to print the peer=<number> for unbound sockets in the existing /proc/net/unix file, but it was left unfinished and had problems with bound sockets - for those the peer inode was still unknown and the name didn't help at all.

I'd like to have this ability (determining the unix connection endpoints) implemented and propose to introduce a /proc/net/unix_peers file with socket inode number pairs. For not connected sockets 0 is printed.

Are there strong objections against this approach?

Patches apply to net-next tree.