diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-14 22:42:47 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-10-14 22:44:33 +0200 |
commit | 754728ab4f1008f554a393055c16f3dade93fb4e (patch) | |
tree | 067cab866e38d19fe4a2da19e527245b3a977396 /kernels/marlin | |
parent | kernels: add wahoo (diff) | |
download | android-wireguard-module-builder-754728ab4f1008f554a393055c16f3dade93fb4e.tar.xz android-wireguard-module-builder-754728ab4f1008f554a393055c16f3dade93fb4e.zip |
kernels: marlin: hack around unexported tvec_base_deferrable
Qualcomm made wild changes to the timers in 50f9e740, but in the process
they forgot to EXPORT_SYMBOL(tvec_base_deferrable). So, we claw it back
the ugly way.
Diffstat (limited to 'kernels/marlin')
-rw-r--r-- | kernels/marlin/do.bash | 4 | ||||
-rw-r--r-- | kernels/marlin/tvec_base_deferrable-hack.patch | 31 |
2 files changed, 35 insertions, 0 deletions
diff --git a/kernels/marlin/do.bash b/kernels/marlin/do.bash new file mode 100644 index 0000000..b568033 --- /dev/null +++ b/kernels/marlin/do.bash @@ -0,0 +1,4 @@ +#!/bin/bash +set -ex +BASE="$(readlink -f "$(dirname "$(readlink -f "$0")")")" +patch -d WireGuard -p1 < "$BASE/tvec_base_deferrable-hack.patch" diff --git a/kernels/marlin/tvec_base_deferrable-hack.patch b/kernels/marlin/tvec_base_deferrable-hack.patch new file mode 100644 index 0000000..1eef1db --- /dev/null +++ b/kernels/marlin/tvec_base_deferrable-hack.patch @@ -0,0 +1,31 @@ +diff --git a/src/ratelimiter.c b/src/ratelimiter.c +index e33ec72a..27a34071 100644 +--- a/src/ratelimiter.c ++++ b/src/ratelimiter.c +@@ -19,6 +19,7 @@ + #include <linux/siphash.h> + #include <linux/mm.h> + #include <linux/slab.h> ++#include <linux/timer.h> + #include <net/ip.h> + + static struct kmem_cache *entry_cache; +@@ -29,6 +30,7 @@ static u64 init_refcnt; /* Protected by init_lock, hence not atomic. */ + static atomic_t total_entries = ATOMIC_INIT(0); + static unsigned int max_entries, table_size; + static void wg_ratelimiter_gc_entries(struct work_struct *); ++struct tvec_base { char herp_derp; } tvec_base_deferrable; + static DECLARE_DEFERRABLE_WORK(gc_work, wg_ratelimiter_gc_entries); + static struct hlist_head *table_v4; + #if IS_ENABLED(CONFIG_IPV6) +@@ -216,6 +218,10 @@ err: + + void wg_ratelimiter_uninit(void) + { ++ struct timer_list dummy_timer; ++ setup_deferrable_timer_on_stack(&dummy_timer, NULL, 0); ++ gc_work.timer.base = dummy_timer.base; ++ + mutex_lock(&init_lock); + if (!init_refcnt || --init_refcnt) + goto out; |