From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: ju.orth@gmail.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 9ce191d1 for ; Sun, 9 Sep 2018 15:13:45 +0000 (UTC) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 6316fe8c for ; Sun, 9 Sep 2018 15:13:45 +0000 (UTC) Received: by mail-wm0-x233.google.com with SMTP id n11-v6so18816006wmc.2 for ; Sun, 09 Sep 2018 08:14:22 -0700 (PDT) Return-Path: From: Julian Orth To: wireguard@lists.zx2c4.com Subject: [PATCH v2 00/10] Allow changing the transit namespace Date: Sun, 9 Sep 2018 17:13:52 +0200 Message-Id: <20180909151402.6033-1-ju.orth@gmail.com> List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This is v2 of [1]. As in v1, this series allows unprivileged users to create Wireguard devices within a user and network namespace and then move the Wireguard UDP socket to the init namespace. This allows Wireguard to be used in unprivileged containers. You can see the new functionality in this bash script: #!/bin/bash exec 100<>/dev/udp/127.0.0.1/0 exec 101<>/dev/udp/::1/0 unshare -r -U -n -- bash < transit-credentials [,] The first fd must refer to the IPv4 socket and the second one to the IPv6 socket. The second fd is optional iff the kernel was configured without IPv6 support. [1] https://lists.zx2c4.com/pipermail/wireguard/2018-September/003322.html Julian Orth (10): device: protect socket_init with device_update_lock device: rename creating_net to transit_net device: store a copy of the device net socket: allow modification of transit_net netlink: allow modification of transit net tools: allow modification of transit net tests: add test for transit-net netlink: require CAP_NET_ADMIN for socket changes netlink: allow bypassing CAP_NET_ADMIN tools: add support for transit-credentials src/device.c | 44 ++++++++------ src/device.h | 6 +- src/netlink.c | 127 +++++++++++++++++++++++++++++++++++------ src/socket.c | 18 +++--- src/socket.h | 6 +- src/tests/netns.sh | 40 +++++++++++++ src/tools/config.c | 62 ++++++++++++++++++++ src/tools/containers.h | 10 +++- src/tools/ipc.c | 8 +++ src/tools/man/wg.8 | 9 ++- src/tools/set.c | 2 +- src/uapi/wireguard.h | 24 +++++++- 12 files changed, 300 insertions(+), 56 deletions(-) -- 2.18.0