Re: [ANNOUNCE] WireGuard Snapshot `0.0.20181007` Available

2018-10-07 Thread logcabin
I get this when building on armv7, but it doesn't seem to affect the build: echo ' Building modules, stage 2.'; make -f ./scripts/Makefile.modpost grep: ./arch/arm/Kbuild: No such file or directory On Sun, Oct 7, 2018, at 6:37 PM, Jason A. Donenfeld wrote: > On Sun, Oct 7, 2018 at 10:49 PM

Re: [ANNOUNCE] WireGuard Snapshot `0.0.20181007` Available

2018-10-07 Thread Jason A. Donenfeld
On Sun, Oct 7, 2018 at 10:49 PM Jordan Glover wrote: > I got an error when doing in-tree build using > WireGuard/contrib/kernel-tree/create-patch.sh > > net/wireguard/receive.c:338:10: fatal error: selftest/counter.c: No such file > or directory > #include "selftest/counter.c" >

Re: [ANNOUNCE] WireGuard Snapshot `0.0.20181007` Available

2018-10-07 Thread Jordan Glover
‐‐‐ Original Message ‐‐‐ On Sunday, October 7, 2018 5:20 PM, Jason A. Donenfeld wrote: > Hello, > > A new snapshot, `0.0.20181007`, has been tagged in the git repository. > > Please note that this snapshot is, like the rest of the project at this point > in time, experimental, and does

Re: [PATCH v4 08/12] netlink: allow modification of transit net

2018-10-07 Thread Julian Orth
On 10/7/18 4:11 PM, Julian Orth wrote: > +static int set_socket(struct wireguard_device *wg, struct nlattr **attrs) > { [...] > > - ret = test_socket_net_capable(wg->transit_net); > + ret = test_socket_net_capable(net ? : wg->transit_net); This is wrong. The capability is checked even

Re: [PATCH v4 01/12] device: protect socket_init with device_update_lock

2018-10-07 Thread Julian Orth
On 10/7/18 5:48 PM, Jason A. Donenfeld wrote: > set_device takes rtnl_lock(), and ndo_open is called while holding the > rtnl lock too. (Try adding `BUG_ON(!rtnl_is_locked());` there.) I've confirmed this and will remove this patch from the next version.

Re: [PATCH v4 01/12] device: protect socket_init with device_update_lock

2018-10-07 Thread Jason A. Donenfeld
set_device takes rtnl_lock(), and ndo_open is called while holding the rtnl lock too. (Try adding `BUG_ON(!rtnl_is_locked());` there.) ___ WireGuard mailing list WireGuard@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/wireguard

[ANNOUNCE] WireGuard Snapshot `0.0.20181007` Available

2018-10-07 Thread Jason A. Donenfeld
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello, A new snapshot, `0.0.20181007`, has been tagged in the git repository. Please note that this snapshot is, like the rest of the project at this point in time, experimental, and does not consitute a real release that would be considered

[PATCH v4 12/12] tests: add test for transit-net

2018-10-07 Thread Julian Orth
--- src/tests/netns.sh | 40 1 file changed, 40 insertions(+) diff --git a/src/tests/netns.sh b/src/tests/netns.sh index 568612c..4cc6b44 100755 --- a/src/tests/netns.sh +++ b/src/tests/netns.sh @@ -222,6 +222,46 @@ n1 wg set wg0 peer "$more_specific_key"

[PATCH v4 10/12] tools: allow specifying the device namespace

2018-10-07 Thread Julian Orth
The user can now use wg --netns to specify the network namespace in which wg should act. This sets the attribute WGDEVICE_A_DEV_NETNS_PID or WGDEVICE_A_DEV_NETNS_FD. In the case of wg --netns show all we have to try to enter the network namespace because the kernel interface does not allow

[PATCH v4 11/12] tools: allow modification of transit net

2018-10-07 Thread Julian Orth
The command is wg set [...] transit-netns [...] For example: wg set wg0 transit-netns 1 wg set wg0 transit-netns /proc/1/ns/net --- src/tools/config.c | 8 src/tools/containers.h | 5 - src/tools/ipc.c| 4 src/tools/man/wg.8 | 9 +++-- src/tools/set.c

[PATCH v4 05/12] device: rename creating_net to transit_net

2018-10-07 Thread Julian Orth
--- src/device.c | 20 ++-- src/device.h | 4 ++-- src/netlink.c | 4 ++-- src/socket.c | 8 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/device.c b/src/device.c index 49f9634..ebcd79c 100644 --- a/src/device.c +++ b/src/device.c @@ -243,8

[PATCH v4 06/12] device: store a copy of the device net

2018-10-07 Thread Julian Orth
This eliminates the need for have_transit_net_ref because have_transit_net_ref == true if and only if dev_net != transit_net. --- src/device.c | 27 +-- src/device.h | 4 +++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/src/device.c b/src/device.c

[PATCH v4 08/12] netlink: allow modification of transit net

2018-10-07 Thread Julian Orth
This commit adds two new attributes of which at most one may be provided: * WGDEVICE_A_TRANSIT_NETNS_PID: NLA_U32 * WGDEVICE_A_TRANSIT_NETNS_FD: NLA_U32 The transit namespace is then set to this namespace. The caller must either be in this namespace or have CAP_NET_ADMIN in it. ---

[PATCH v4 02/12] netlink: check for CAP_NET_ADMIN manually

2018-10-07 Thread Julian Orth
--- src/netlink.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/netlink.c b/src/netlink.c index 56749ba..ca90cdf 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -169,6 +169,7 @@ err: static int get_device_start(struct netlink_callback *cb) {

[PATCH v4 09/12] tools: add framework for shared options

2018-10-07 Thread Julian Orth
--- src/tools/containers.h | 3 +++ src/tools/genkey.c | 3 ++- src/tools/pubkey.c | 3 ++- src/tools/set.c | 3 ++- src/tools/setconf.c | 3 ++- src/tools/show.c| 3 ++- src/tools/showconf.c| 3 ++- src/tools/subcommands.h | 14 ++-

[PATCH v4 03/12] netlink: allow specifying the device namespace

2018-10-07 Thread Julian Orth
This commit adds two new attributes of which at most one may be provided: * WGDEVICE_A_DEV_NETNS_PID: NLA_U32 * WGDEVICE_A_DEV_NETNS_FD: NLA_U32 The Wireguard device is then looked up in this namespace instead of the namespace of the netlink socket. --- src/netlink.c| 82

[PATCH v4 07/12] socket: allow modification of transit_net

2018-10-07 Thread Julian Orth
--- src/device.c | 8 +--- src/netlink.c | 2 +- src/socket.c | 18 ++ src/socket.h | 6 +++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/device.c b/src/device.c index ddb8fd7..a0b771b 100644 --- a/src/device.c +++ b/src/device.c @@ -54,7 +54,7

[PATCH v4 00/12] Allow changing the transit namespace

2018-10-07 Thread Julian Orth
Hello list, This series is simply v3 [1] rebased on master. Julian [1] https://lists.zx2c4.com/pipermail/wireguard/2018-September/003358.html Julian Orth (12): device: protect socket_init with device_update_lock netlink: check for CAP_NET_ADMIN manually netlink: allow specifying the

[PATCH v4 01/12] device: protect socket_init with device_update_lock

2018-10-07 Thread Julian Orth
`set_port` in netlink.c races with `open` in device.c. This can cause the following code flow: * thread 1: set_port: device is not up * thread 2: device is opened * thread 2: open: called and calls socket_init with the original port * thread 1: set_port: sets incoming_port to the new port and

Re: [PATCH 1/1] fix install target for dkms sources

2018-10-07 Thread Jason A. Donenfeld
Thanks. I'll fix this up and cut a new snapshot. ___ WireGuard mailing list WireGuard@lists.zx2c4.com https://lists.zx2c4.com/mailman/listinfo/wireguard

[PATCH 1/1] fix install target for dkms sources

2018-10-07 Thread Christian Hesse
From: Christian Hesse Commit ad5e4210 (global: rename include'd C files to be .c) breaks install target for dkms sources. Fix installing selftest/*.c. Signed-off-by: Christian Hesse --- src/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile