aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* compat: more robust ktime backportJason A. Donenfeld2018-06-241-3/+8
| | | | This is needed for frankenkernels, like android-common.
* global: use fast boottime instead of normal boottimeJason A. Donenfeld2018-06-231-3/+3
| | | | Generally if we're inaccurate by a few nanoseconds, it doesn't matter.
* global: use ktime boottime instead of jiffiesJason A. Donenfeld2018-06-231-9/+10
| | | | | | | | Since this is a network protocol, expirations need to be accounted for, even across system suspend. On real systems, this isn't a problem, since we're clearing all keys before suspend. But on Android, where we don't do that, this is something of a problem. So, we switch to using boottime instead of jiffies.
* compat: use stabler lkml linksJason A. Donenfeld2018-06-191-2/+2
| | | | | | This will redirect to whichever archive kernel.org thinks is best. Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
* receive: drop handshake packets if rng is not initializedJason A. Donenfeld2018-06-191-0/+53
| | | | Otherwise it's too easy to trigger cookie reply messages.
* compat: don't clash with get_random_u32 backportsJason A. Donenfeld2018-05-241-3/+2
| | | | | | Our previous heuristic wasn't good enough, since CopperheadOS backported CANARY_MASK without backporting get_random_u32, as Qualcomm did, so now we just entirely rename all invocations of the function.
* compat: work around qcom 4.9 backportsJason A. Donenfeld2018-05-221-0/+3
| | | | | | | Qualcomm backported the get_random_u32 patch, even though kernel.org didn't, which is a problem. They also backported another patch in the same place which defines a new macro variable, so use this as a differentiator.
* compat: backport for OpenSUSE 15Jason A. Donenfeld2018-05-141-1/+1
|
* compat: don't clear header bits on RHELJason A. Donenfeld2018-05-131-1/+4
| | | | | | | | | | The 3.10 kernel from Red Hat puts head_frag in between headers_start and headers_end. This is triggered on the latest i40e driver. This results in the packet being freed incorrectly, crashing the system. So, this patch just ensures we don't zero any of the header bits. The whole issue of zeroing header bits probably should be revisited sometime somewhat soon.
* compat: handle RHEL 7.5's recent backportsJason A. Donenfeld2018-05-131-5/+5
|
* socket: use skb_put_dataJason A. Donenfeld2018-05-131-0/+9
|
* compat: remove unused dev_recursion_level backportJason A. Donenfeld2018-04-161-7/+0
|
* compat: support OpenSUSE 15Jason A. Donenfeld2018-03-091-3/+6
|
* compat: silence warning on frankenkernelsJason A. Donenfeld2018-03-091-0/+3
| | | | Some Android 3.18 devices backport this macro.
* compat: stable kernels are now receiving b87b619Jason A. Donenfeld2018-03-071-1/+1
|
* compat: workaround netlink refcount bugJason A. Donenfeld2018-03-021-1/+1
| | | | | | | For now it looks like only 4.16 has this, but we'll keep track in case others add it too. Upstream-fix: b87b6194be63 ("netlink: put module reference if dump start fails")
* global: year bumpJason A. Donenfeld2018-01-031-1/+1
|
* compat: kernels < 3.13 modified genl_opsJason A. Donenfeld2017-12-211-1/+2
|
* chacha20poly1305: wire up avx512vl for skylake-xJason A. Donenfeld2017-12-111-2/+5
|
* global: add SPDX tags to all filesGreg Kroah-Hartman2017-12-091-1/+4
| | | | | | | | | | | | | It's good to have SPDX identifiers in all files as the Linux kernel developers are working to add these identifiers to all files. Update all files with the correct SPDX license identifier based on the license text of the project or based on the license in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Modified-by: Jason A. Donenfeld <Jason@zx2c4.com>
* compat: fix 3.10 backportJason A. Donenfeld2017-11-291-0/+24
| | | | | | | For archs that do not provide the magic csum function, we need to provide the generic function. Also, some obscure 3.10s have backported the int size macros, so we ifndef around that to avoid potentially fatal warnings.
* compat: support 4.15's netlink and barrier changesJason A. Donenfeld2017-11-261-0/+6
|
* compat: fix typo and rangesJason A. Donenfeld2017-11-231-1/+1
|
* compat: support AVX512BW+VL by lyingJason A. Donenfeld2017-11-221-2/+15
|
* compat: support timespec64 on old kernelsJason A. Donenfeld2017-11-221-0/+5
|
* chacha20poly1305: import x86_64 primitives from OpenSSLSamuel Neves2017-11-221-4/+7
| | | | | | x86_64 only at the moment. SSSE3, AVX, AVX2, AVX512. Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
* compat: new kernels have netlink fixesJason A. Donenfeld2017-11-221-12/+9
|
* compat: stable finally backported fixJason A. Donenfeld2017-11-221-1/+1
|
* compat: fix compilation with PaXJason A. Donenfeld2017-11-141-0/+12
| | | | | | Despite not having access to the latest grsecurity source, I still do very much want to keep supporting it, so this patch is my best guess at what will work.
* netlink: make sure we reserve space for NLMSG_DONEJason A. Donenfeld2017-11-101-1/+16
| | | | | | | Otherwise, if messages pack really close together, we'll exceed the size of the sk_buff and return ENOBUFS. I suspect this has been the cause of a lot of weird bugs that people just worked around by increasing the receive buffer size. This actually addresses the root cause.
* compat: 4.4.0 has strange ECN functionJason A. Donenfeld2017-11-101-1/+2
|
* timers: switch to kees' new timer_list functionsJason A. Donenfeld2017-11-011-0/+5
|
* device: only take reference if netns is differentJason A. Donenfeld2017-10-311-0/+5
| | | | | | If we take two references, the namespace and the device are never freed in the usual manner. We should thus only take a reference to another namespace when it is a different namespace from our own.
* global: infuriating kernel iterator styleJason A. Donenfeld2017-10-311-1/+1
| | | | | | | | | | | | | | | | | One types: for (i = 0 ... So one should also type: for_each_obj (obj ... But the upstream kernel style guidelines are insane, and so we must instead do: for_each_obj(obj ... Ugly, but one must choose his battles wisely.
* compat: be sure to include header before testingJason A. Donenfeld2017-10-311-0/+1
| | | | Reported-by: Aaron M. D. Jones <aaronmdjones@gmail.com>
* crypto/avx: make sure we can actually use ymm registersJason A. Donenfeld2017-10-311-0/+20
|
* compat: support READ_ONCEJason A. Donenfeld2017-10-171-0/+4
|
* compat: just make ro_after_init read_mostlyJason A. Donenfeld2017-10-171-0/+4
|
* compat: move version logic to compat.h and out of main .cJason A. Donenfeld2017-10-111-0/+14
|
* compat: macro rewrite netlink instead of clutteringJason A. Donenfeld2017-10-051-0/+13
|
* compat: RHEL backported netlink changesJason A. Donenfeld2017-10-051-1/+1
|
* compat: conditionally redefine GENL_UNS_ADMIN_PERMJason A. Donenfeld2017-10-051-0/+3
|
* global: use _WG prefix for include guardsJason A. Donenfeld2017-10-031-3/+3
| | | | Suggested-by: Sultan Alsawaf <sultanxda@gmail.com>
* netlink: switch from ioctl to netlink for configurationJason A. Donenfeld2017-10-021-0/+37
|
* compat: support RHEL 7.4Jason A. Donenfeld2017-09-181-1/+1
|
* socket: improve reply-to-src algorithmJason A. Donenfeld2017-08-231-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We store the destination IP of incoming packets as the source IP of outgoing packets. When we send outgoing packets, we then ask the routing table for which interface to use and which source address, given our inputs of the destination address and a suggested source address. This all is good and fine, since it means we'll successfully reply using the correct source address, correlating with the destination address for incoming packets. However, what happens when default routes change? Or when interface IP addresses change? Prior to this commit, after getting the response from the routing table of the source address, destination address, and interface, we would then make sure that the source address actually belonged to the outbound interface. If it didn't, we'd reset our source address to zero and re-ask the routing table, in which case the routing table would then give us the default IP address for sending that packet. This worked mostly fine for most purposes, but there was a problem: what if WireGuard legitimately accepted an inbound packet on a default interface using an IP of another interface? In this case, falling back to asking for the default source IP was not a good strategy, since it'd nearly always mean we'd fail to reply using the right source. So, this commit changes the algorithm slightly. Rather than falling back to using the default IP if the preferred source IP doesn't belong to the outbound interface, we have two checks: we make sure that the source IP address belongs to _some_ interface on the system, no matter which one (so long as it's within the network namespace), and we check whether or not the interface of an incoming packet matches the returned interface for the outbound traffic. If both these conditions are true, then we proceed with using this source IP address. If not, we fall back to the default IP address.
* socket: move print function from compatJason A. Donenfeld2017-07-281-10/+0
|
* compat: get rid of warnings on frankenkernelsJason A. Donenfeld2017-07-281-0/+8
|
* compat: work around odd kernels that backport kv[mz]allocJason A. Donenfeld2017-07-271-3/+5
|
* global: use pointer to net_deviceJason A. Donenfeld2017-07-201-7/+0
| | | | | | DaveM prefers it to be this way per [1]. [1] http://www.spinics.net/lists/netdev/msg443992.html