summaryrefslogtreecommitdiffstatshomepage
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* version: bump snapshotJason A. Donenfeld2019-05-312-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* zinc: update copyrightJason A. Donenfeld2019-05-292-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* blake2s: shorten ssse3 loopSamuel Neves2019-05-291-857/+66
| | | | | | | | This (mostly) preserves the performance (as measured on Haswell and *lake) of last commit, but it drastically reduces code size. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* blake2s,chacha: latency tweakSamuel Neves2019-05-295-618/+982
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In every odd-numbered round, instead of operating over the state x00 x01 x02 x03 x05 x06 x07 x04 x10 x11 x08 x09 x15 x12 x13 x14 we operate over the rotated state x03 x00 x01 x02 x04 x05 x06 x07 x09 x10 x11 x08 x14 x15 x12 x13 The advantage here is that this requires no changes to the 'x04 x05 x06 x07' row, which is in the critical path. This results in a noticeable latency improvement of roughly R cycles, for R diagonal rounds in the primitive. In the case of BLAKE2s, which I also moved from requiring AVX to only requiring SSSE3, we save approximately 30 cycles per compression function call on Haswell and Skylake. In other words, this is an improvement of ~0.6 cpb. This idea was pointed out to me by Shunsuke Shimizu, though it appears to have been around for longer. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: do not check for alignment with ubsanJason A. Donenfeld2019-05-291-0/+1
| | | | | | It insta-crashes on x86. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* zinc: arm64: use cpu_get_elf_hwcap accessor for 5.2Jason A. Donenfeld2019-05-293-2/+6
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* kbuild: account for recent upstream changesJason A. Donenfeld2019-05-292-11/+11
| | | | | | | | Apparently cdd750bfb1f76fe9be8cfb53cbe77b2e811081ab changed things, so we fall back onto this hack. Reported-by: Alex Xu <alex@alxu.ca> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* timers: add jitter on ack failure reinitiationJason A. Donenfeld2019-05-291-2/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: build iproute2 with libmnl supportJason A. Donenfeld2019-05-291-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* netlink: use new strict length types in policy for 5.2Jason A. Donenfeld2019-05-293-14/+29
| | | | | Reported-by: Bruno Wolff III <bruno@wolff.to> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: use newer iproute2 and kernelJason A. Donenfeld2019-05-291-9/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* socket: set ignore_df=1 on xmitJoe Holden2019-05-292-0/+6
| | | | | | | | This allows the kernel to generate ipv6 fragments. Apply the same to ipv4 for consistency. Signed-off-by: Joe Holden <jwh@zorins.us> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: udp_tunnel: force cast sk_data_readyJason A. Donenfeld2019-04-141-1/+3
| | | | | Reference: https://lists.zx2c4.com/pipermail/wireguard/2019-April/004081.html Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bump snapshotJason A. Donenfeld2019-04-062-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: initialize list head when removing intermediate nodesJason A. Donenfeld2019-04-062-1/+5
| | | | | | | | | | | Otherwise if this list item is later reused, we'll crash on list poison or worse. Also, add a version of Mimka's reproducer to netns.sh to catch these types of bugs in the future. Reported-by: Mimka <mikma.wg@lists.m7n.se> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: backport skb_mark_not_on_listJason A. Donenfeld2019-03-291-0/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* blake2s: remove outlen parameter from finalJason A. Donenfeld2019-03-274-12/+11
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* blake2s: simplifySamuel Neves2019-03-272-40/+12
| | | | | Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: set framewarn 1280 for 64bit and 1024 for 32bitJason A. Donenfeld2019-03-2514-4/+14
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* device: use skb accessor functions where possibleJason A. Donenfeld2019-03-251-2/+2
| | | | | Suggested-by: David Miller <davem@davemloft.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: do not use __always_inlineJason A. Donenfeld2019-03-251-9/+9
| | | | | | | DaveM doth forbid. Suggested-by: David Miller <davem@davemloft.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* peerlookup: rename from hashtablesJason A. Donenfeld2019-03-257-9/+9
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: the _bh variety of rcu helpers have been unifiedJason A. Donenfeld2019-03-177-12/+57
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: nf_nat_core.h was removed upstreamBruno Wolff III2019-03-141-0/+2
| | | | | | | | In d2c5c103b133 ("netfilter: nat: remove nf_nat_l3proto.h and nf_nat_core.h"). Signed-off-by: Bruno Wolff III <bruno@wolff.to> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bump snapshotJason A. Donenfeld2019-02-272-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* queueing: net-next has changed signature of skb_probe_transport_headerJason A. Donenfeld2019-02-272-1/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* allowedips: maintain per-peer list of allowedipsJason A. Donenfeld2019-02-266-160/+129
| | | | | | | | | | This makes `wg show` and `wg showconf` and the like significantly faster, since we don't have to iterate through every node of the trie for every single peer. It also makes netlink cursor resumption much less problematic, since we're just iterating through a list, rather than having to save a traversal stack. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* peer: only synchronize_rcu_bh and traverse trie once when removing all peersJason A. Donenfeld2019-02-252-20/+42
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* netlink: don't remove allowed ips for new peersJason A. Donenfeld2019-02-251-0/+3
| | | | | | This causes needless traversal of the trie. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Makefile: make the depmod path configurableLuis Ressel2019-02-171-1/+2
| | | | | Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Makefile: don't duplicate code in install and modules-installLuis Ressel2019-02-171-5/+5
| | | | | Signed-off-by: Luis Ressel <aranea@aixah.de> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: backport ALIGN_DOWNJason A. Donenfeld2019-02-171-0/+7
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: ipv6_stub is sometimes nullJason A. Donenfeld2019-02-171-1/+1
| | | | | | | | On ancient kernels, ipv6_stub is sometimes null in cases where IPv6 has been disabled with a command line flag or other failures. Reported-by: Anatoli <me@anatoli.ws> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* chacha20: name enumsJason A. Donenfeld2019-02-041-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* noise: store clamped key instead of raw keyJason A. Donenfeld2019-02-037-14/+16
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* chacha20poly1305: permit unaligned strides on certain platformsJason A. Donenfeld2019-02-031-18/+14
| | | | | | | | The map allocations required to fix this are mostly slower than unaligned paths. Reported-by: Louis Sautier <sbraz@gentoo.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* hashtables: decouple hashtable allocations from the main device allocationSultan Alsawaf2019-02-039-25/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: [<0000000000000000>] __switch_to+0x94/0xb8 [<0000000000000000>] __alloc_pages_nodemask+0x764/0x7e8 [<0000000000000000>] kmalloc_order+0x20/0x40 [<0000000000000000>] __kmalloc+0x144/0x1a0 [<0000000000000000>] alloc_netdev_mqs+0x5c/0x368 [<0000000000000000>] rtnl_create_link+0x48/0x180 [<0000000000000000>] rtnl_newlink+0x410/0x708 [<0000000000000000>] rtnetlink_rcv_msg+0x190/0x1f8 [<0000000000000000>] netlink_rcv_skb+0x4c/0xf8 [<0000000000000000>] rtnetlink_rcv+0x30/0x40 [<0000000000000000>] netlink_unicast+0x18c/0x208 [<0000000000000000>] netlink_sendmsg+0x19c/0x348 [<0000000000000000>] sock_sendmsg+0x3c/0x58 [<0000000000000000>] ___sys_sendmsg+0x290/0x2b0 [<0000000000000000>] __sys_sendmsg+0x58/0xa0 [<0000000000000000>] SyS_sendmsg+0x10/0x20 [<0000000000000000>] el0_svc_naked+0x34/0x38 [<0000000000000000>] 0xffffffffffffffff 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. Signed-off-by: Sultan Alsawaf <sultan@kerneltoast.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* queueing: more reasonable allocator function conventionJason A. Donenfeld2019-02-033-4/+4
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* noise: whiten the nanoseconds portion of the timestampJason A. Donenfeld2019-02-031-0/+9
| | | | | | | This mitigates unrelated sidechannel attacks that think they can turn WireGuard into a useful time oracle. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* version: bump snapshotJason A. Donenfeld2019-01-232-2/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* netlink: use __kernel_timespec for handshake timeJason A. Donenfeld2019-01-236-8/+28
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: normalize -> clampJason A. Donenfeld2019-01-234-17/+10
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: enable FP on MIPSJason A. Donenfeld2019-01-234-0/+4
| | | | | | This is a change for Linux 5.0. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: version bump to bash 5.0Jason A. Donenfeld2019-01-231-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* Kconfig: IPsec isn't IPSecJason A. Donenfeld2019-01-231-1/+1
| | | | | Reported-by: Raf Czlonka <rczlonka@gmail.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ratelimiter: totalram_pages is now a functionJason A. Donenfeld2019-01-232-2/+6
| | | | | Reported-by: Alex Xu <alex@alxu.ca> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* noise: replace getnstimeofday64 with ktime_get_real_ts64Jason A. Donenfeld2019-01-232-2/+2
| | | | | | | | | | The former was just a wrapper around the latter, and so upstream is now removing it. Also adjust the compat kludge to deal with this. Reported-by: Alex Xu <alex@alxu.ca> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* ratelimiter: build tests with !IPV6Jason A. Donenfeld2019-01-231-5/+2
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* qemu: version bump kernelJason A. Donenfeld2019-01-231-1/+1
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
* global: update copyrightJason A. Donenfeld2019-01-0780-81/+81
| | | | Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>