189 Commits

Author SHA1 Message Date
Jason A. Donenfeld
0bfe7f6823 testing/wireguard: upgrade to 0.0.20190227
* wg-quick: freebsd: allow loopback to work

FreeBSD adds a route for point-to-point destination addresses. We don't
really want to specify any destination address, but unfortunately we
have to. Before we tried to cheat by giving our own address as the
destination, but this had the unfortunate effect of preventing
loopback from working on our local ip address. We work around this with
yet another kludge: we set the destination address to 127.0.0.1. Since
127.0.0.1 is already assigned to an interface, this has the same effect
of not specifying a destination address, and therefore we accomplish the
intended behavior. Note that the bad behavior is still present in Darwin,
where such workaround does not exist.

* tools: remove unused check phony declaration
* highlighter: when subtracting char, cast to unsigned
* chacha20: name enums
* tools: fight compiler slightly harder
* tools: c_acc doesn't need to be initialized
* queueing: more reasonable allocator function convention

Usual nits.

* systemd: wg-quick should depend on nss-lookup.target

Since wg-quick(8) calls wg(8) which does hostname lookups, we should
probably only run this after we're allowed to look up hostnames.

* compat: backport ALIGN_DOWN
* noise: whiten the nanoseconds portion of the timestamp

This mitigates unrelated sidechannel attacks that think they can turn
WireGuard into a useful time oracle.

* hashtables: decouple hashtable allocations from the main device allocation

The hashtable allocations are quite large, and cause the device allocation in
the net framework to stall sometimes while it tries to find a contiguous
region that can fit the device struct. To fix the allocation stalls, decouple
the hashtable allocations from the device allocation and allocate the
hashtables with kvmalloc's implicit __GFP_NORETRY so that the allocations fall
back to vmalloc with little resistance.

* chacha20poly1305: permit unaligned strides on certain platforms

The map allocations required to fix this are mostly slower than unaligned
paths.

* noise: store clamped key instead of raw key

This causes `wg show` to now show the right thing. Useful for doing
comparisons.

* compat: ipv6_stub is sometimes null

On ancient kernels, ipv6_stub is sometimes null in cases where IPv6 has
been disabled with a command line flag or other failures.

* Makefile: don't duplicate code in install and modules-install
* Makefile: make the depmod path configurable

* queueing: net-next has changed signature of skb_probe_transport_header

A 5.1 change. This could change again, but for now it allows us to keep this
snapshot aligned with our upstream submissions.

* netlink: don't remove allowed ips for new peers
* peer: only synchronize_rcu_bh and traverse trie once when removing all peers
* allowedips: maintain per-peer list of allowedips

This is a rather big and important change that makes it much much faster to do
operations involving thousands of peers. Batch peer/allowedip addition and
clearing is several orders of magnitude faster now.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-02-28 10:51:34 +02:00
Natanael Copa
c8687463b6 testing/wireguard-vanilla: rebuild against kernel 4.19.26-r0 2019-02-27 16:05:16 +00:00
Natanael Copa
40ebc0f35d testing/wireguard-vanilla: rebuild against kernel 4.19.25-r0 2019-02-25 08:40:33 +00:00
Natanael Copa
72c3d5f1a4 testing/wireguard-vanilla: rebuild against kernel 4.19.24-r0 2019-02-21 16:05:34 +00:00
Natanael Copa
5dafd2e49a testing/wireguard-vanilla: rebuild against kernel 4.19.21-r0 2019-02-13 17:54:20 +00:00
Natanael Copa
402e4e8820 testing/wireguard-vanilla: rebuild against kernel 4.19.20-r1 2019-02-08 19:51:45 +00:00
Natanael Copa
ea1b68f2ff testing/wireguard-vanilla: rebuild against kernel 4.19.20-r0 2019-02-08 18:54:02 +00:00
Natanael Copa
78d0d55095 testing/wireguard-vanilla: rebuild against kernel 4.19.19-r0 2019-02-04 19:22:47 +00:00
Natanael Copa
8c4f03cc40 testing/wireguard-vanilla: rebuild against kernel 4.19.18-r0 2019-01-26 21:57:00 +00:00
Jason A. Donenfeld
ee1955b85c testing/wireguard: upgrade to 0.0.20190123
* tools: curve25519: handle unaligned loads/stores safely

This should fix sporadic crashes with `wg pubkey` on certain architectures.

* netlink: auth socket changes against namespace of socket

In WireGuard, the underlying UDP socket lives in the namespace where the
interface was created and doesn't move if the interface is moved. This
allows one to create the interface in some privileged place that has
Internet access, and then move it into a container namespace that only
has the WireGuard interface for egress. Consider the following
situation:

1. Interface created in namespace A. Socket therefore lives in namespace A.
2. Interface moved to namespace B. Socket remains in namespace A.
3. Namespace B now has access to the interface and changes the listen
port and/or fwmark of socket. Change is reflected in namespace A.

This behavior is arguably _fine_ and perhaps even expected or
acceptable. But there's also an argument to be made that B should have
A's cred to do so. So, this patch adds a simple ns_capable check.

* ratelimiter: build tests with !IPV6

Should reenable building in debug mode for systems without IPv6.

* noise: replace getnstimeofday64 with ktime_get_real_ts64
* ratelimiter: totalram_pages is now a function
* qemu: enable FP on MIPS

Linux 5.0 support.

* keygen-html: bring back pure javascript implementation

Benoît Viguier has proofs that values will stay well within 2^53. We
also have an improved carry function that's much simpler. Probably more
constant time than emscripten's 64-bit integers.

* contrib: introduce simple highlighter library

This is the highlighter library being used in:
- https://twitter.com/EdgeSecurity/status/1085294681003454465
- https://twitter.com/EdgeSecurity/status/1081953278248796165

It's included here as a contrib example, so that others can paste it into
their own GUI clients for having the same strictly validating highlighting.

* netlink: use __kernel_timespec for handshake time

This readies us for Y2038. See https://lwn.net/Articles/776435/ for more info.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2019-01-24 18:54:03 +02:00
Natanael Copa
2ed6eeb005 testing/wireguard-vanilla: rebuild against kernel 4.19.17-r0 2019-01-24 01:10:04 +00:00
Natanael Copa
feccc77e43 testing/wireguard-vanilla: rebuild against kernel 4.19.7-r0 2019-01-23 16:32:28 +00:00
Natanael Copa
2b00827d34 testing/wireguard-vanilla: rebuild against kernel 4.19.16-r1 2019-01-21 21:34:00 +00:00
Natanael Copa
b41df1032b testing/wireguard-vanilla: rebuild against kernel 4.19.16-r0 2019-01-21 16:21:49 +00:00
Natanael Copa
cef759d1fb testing/wireguard-vanilla: rebuild against kernel 4.19.15-r0 2019-01-16 19:24:01 +00:00
Natanael Copa
9938f69fb1 testing/wireguard-vanilla: rebuild against kernel 4.19.14-r0 2019-01-10 08:13:28 +00:00
Natanael Copa
002ba4b009 testing/wireguard-vanilla: rebuild against kernel 4.19.13-r0 2018-12-31 07:53:33 +00:00
Natanael Copa
ce421f4777 testing/wireguard-vanilla: rebuild against kernel 4.19.12 2018-12-27 11:56:59 +00:00
Jason A. Donenfeld
932513c69d testing/wireguard: upgrade to 0.0.20181218
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-12-18 20:02:10 +00:00
Natanael Copa
be2d6a41c8 testing/wireguard-vanilla: rebuild against kernel 4.14.89-r0 2018-12-18 13:34:15 +00:00
Natanael Copa
e48f3f3d98 testing/wireguard-vanilla: rebuild against kernel 4.14.88-r0 2018-12-17 09:44:04 +00:00
Natanael Copa
628e9fcf69 testing/wireguard-vanilla: rebuild against kernel 4.14.86-r0 2018-12-07 06:18:48 +00:00
Natanael Copa
932b6777e0 testing/wireguard-vanilla: rebuild against kernel 4.14.85-r0 2018-12-04 07:07:53 +00:00
Natanael Copa
df08ec1ba9 testing/wireguard-vanilla: rebuild against kernel 4.14.84-r0 2018-11-29 06:59:28 +00:00
Natanael Copa
581d258409 testing/wireguard-vanilla: rebuild against kernel 4.14.82-r0 2018-11-21 10:38:24 +00:00
Jason A. Donenfeld
2d6d4f4faa testing/wireguard: upgrade to 0.0.20181119
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-20 17:33:04 +02:00
Jason A. Donenfeld
11eee56b9c testing/wireguard: upgrade to 0.0.20181115
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-11-15 23:44:12 +02:00
Natanael Copa
01d20d9a3e testing/wireguard-vanilla: rebuild against kernel 4.14.81-r0 2018-11-14 10:00:23 +00:00
Natanael Copa
8496d9853a testing/wireguard-vanilla: rebuild against kernel 4.14.79-r0 2018-11-08 11:07:54 +00:00
Natanael Copa
aca7a56544 testing/wireguard-vanilla: rebuild against kernel 4.14.78-r0 2018-10-23 11:19:06 +00:00
Jason A. Donenfeld
6ebe01c8ff testing/wireguard: upgrade to 0.0.20181018
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-23 11:19:06 +00:00
Natanael Copa
40ab239275 testing/wireguard-vanilla: rebuild against kernel 4.14.77-r0 2018-10-19 08:00:19 +00:00
Natanael Copa
43d4fd7d89 testing/wireguard-vanilla: rebuild against kernel 4.14.76-r1 2018-10-17 13:31:50 +00:00
Natanael Copa
68b0117755 testing/wireguard-vanilla: rebuild against kernel 4.14.76-r0 2018-10-15 09:18:58 +00:00
Jason A. Donenfeld
4f41022887 testing/wireguard: upgrade to 0.0.20181006
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-10-15 09:18:58 +00:00
Natanael Copa
8a7d072f02 testing/wireguard-vanilla: rebuild against kernel 4.14.74-r0 2018-10-04 10:56:17 +00:00
Natanael Copa
da92819824 testing/wireguard-vanilla: rebuild against kernel 4.14.73-r0 2018-10-01 12:14:14 +00:00
Natanael Copa
c024cf38dd testing/wireguard-vanilla: rebuild against kernel 4.14.72-r0 2018-09-28 07:24:36 +00:00
Natanael Copa
fa8d1f60d3 testing/wireguard-vanilla: rebuild against kernel 4.14.71-r0 2018-09-24 08:09:08 +00:00
Jason A. Donenfeld
f745e49cb4 testing/wireguard: upgrade to 0.0.20180918
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-19 02:09:53 +03:00
Natanael Copa
99862e437c testing/wireguard-vanilla: rebuild against kernel 4.14.70-r0 2018-09-17 15:52:46 +00:00
Jason A. Donenfeld
1a4a0a7c7c testing/wireguard: upgrade to 0.0.20180910
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-13 00:05:35 +03:00
Natanael Copa
bc500d5ff6 testing/wireguard-vanilla: rebuild against kernel 4.14.69-r0 2018-09-10 08:24:54 +00:00
Jason A. Donenfeld
3f980f5c01 testing/wireguard: upgrade to 0.0.20180904
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-09-04 20:14:13 +00:00
Natanael Copa
530f8274c1 testing/wireguard-vanilla: rebuild against kernel 4.14.67-r0 2018-08-27 07:52:13 +00:00
Natanael Copa
ea57b07898 testing/wireguard-vanilla: rebuild against kernel 4.14.66-r0 2018-08-22 12:45:49 +00:00
Jason A. Donenfeld
dec7d9bd08 testing/wireguard: upgrade to 0.0.20180809
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2018-08-21 14:51:01 +02:00
Natanael Copa
60261f2a1c testing/wireguard-vanilla: rebuild against kernel 4.14.65-r0 2018-08-20 07:12:25 +00:00
Natanael Copa
047b040c5f testing/wireguard-vanilla: rebuild against kernel 4.14.62-r0 2018-08-14 06:06:47 +00:00
Natanael Copa
35a138e4c3 testing/wireguard-vanilla: rebuild against kernel 4.14.61-r0 2018-08-06 18:36:12 +00:00