Skip to content

Support unix domain sockets across namespaces

Eric W. Biederman containers netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8scm: Reorder scm_cookie.include/net/scm.h+1 -11 reply
2/8user_ns: Introduce user_nsmap_uid and user_ns_map_gid.include/linux/user_namespace.h kernel/user_namespace.c+58 -03 replies
3/8sock: Introduce cred_to_ucredinclude/linux/socket.h net/core/sock.c+19 -01 reply
4/8af_unix: Allow SO_PEERCRED to work across namespaces.include/net/sock.h net/core/sock.c net/unix/af_unix.c+42 -162 replies
5/8af_netlink: Add needed scm_destroy after scm_send.net/netlink/af_netlink.c+8 -32 replies
6/8scm: Capture the full credentials of the scm sender.include/net/scm.h net/core/scm.c+48 -45 replies
7/8af_unix: Allow credentials to work across user and pid namespaces.include/net/af_unix.h net/unix/af_unix.c+33 -241 reply
8/8af_unix: Allow connecting to sockets in other network namespaces.net/unix/af_unix.c+2 -52 replies

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchDaniel LezcanoPavel EmelyanovSerge E. Hallyn
1/8A-b
2/8A-b
3/8A-b
4/8A-b A-b
5/8R-b A-b
6/8A-b
7/8A-b
8/8A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [PATCH 0/8] Support unix domain sockets across namespaces

This patchset takes a addressing all of the issues that crop up with unix domain sockets when the senders and receivers are in separate namespaces.

Without this patchset we can report the wrong pid and uid values in our unix domain credentials.

As a finally this patchset removes the now unnecessary restriction that we only allow unix domain sockets between processes in the same network namespace.

Eric W. Biederman (8):
scm: Reorder scm_cookie.
user_ns: Introduce user_nsmap_uid and user_ns_map_gid.
sock: Introduce cred_to_ucred
af_unix: Allow SO_PEERCRED to work across namespaces.
af_netlink: Add needed scm_destroy after scm_send.
scm: Capture the full credentials of the scm sender.
af_unix: Allow credentials to work across user and pid namespaces.
af_unix: Allow connecting to sockets in other network namespaces.

---
 include/linux/socket.h         |    5 ++
 include/linux/user_namespace.h |   14 ++++++
 include/net/af_unix.h          |    4 +-
 include/net/scm.h              |   30 ++++++++++--
 include/net/sock.h             |    3 +-
 kernel/user_namespace.c        |   44 ++++++++++++++++++
 net/core/scm.c                 |   24 ++++++++++
 net/core/sock.c                |   32 +++++++++++---
 net/netlink/af_netlink.c       |   11 +++-
 net/unix/af_unix.c             |   97 +++++++++++++++++++++++++---------------
 10 files changed, 211 insertions(+), 53 deletions(-)