kernel-fxtec-pro1x/tools/testing/selftests
Jason A. Donenfeld 33fa89ac6b UPSTREAM: wireguard: device: avoid circular netns references
Before, we took a reference to the creating netns if the new netns was
different. This caused issues with circular references, with two
wireguard interfaces swapping namespaces. The solution is to rather not
take any extra references at all, but instead simply invalidate the
creating netns pointer when that netns is deleted.

In order to prevent this from happening again, this commit improves the
rough object leak tracking by allowing it to account for created and
destroyed interfaces, aside from just peers and keys. That then makes it
possible to check for the object leak when having two interfaces take a
reference to each others' namespaces.

Fixes: e7096c131e51 ("net: WireGuard secure network tunnel")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 900575aa33a3eaaef802b31de187a85c4a4b4bd0)
Bug: 152722841
[Jason: netlink notifier uses exit instead of pre_exit]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iea52fe3ca0e41318c392d9e91edb1856de6c9528
2020-10-25 13:40:24 +01:00
..
android selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
arm64 UPSTREAM: selftests, arm64: add kernel headers path for tags_test 2019-10-07 15:27:40 -04:00
bpf selftests/bpf: Fix massive output from test_maps 2020-09-09 19:04:26 +02:00
breakpoints selftests: breakpoints: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
capabilities License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
cgroup tools/testing/selftests/cgroup/cgroup_util.c: cg_read_strcmp: fix null pointer dereference 2020-08-26 10:31:02 +02:00
cpu-hotplug selftests: cpu-hotplug: fix case where CPUs offline > CPUs present 2019-03-13 14:02:28 -07:00
cpufreq selftests: cpufreq: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
drivers selftests: usbip: add wait after attach and before checking port status 2018-10-09 16:13:42 +02:00
efivarfs selftests/efivarfs: add required kernel configs 2018-09-05 10:58:07 -06:00
exec selftests: exec: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
filesystems ANDROID: Incremental fs: Fix issues with very large files 2020-05-05 13:34:18 +00:00
firmware selftests: firmware: Fix it to do root uid check and skip 2020-01-17 19:47:14 +01:00
ftrace selftests/ftrace: fix glob selftest 2020-10-01 13:14:31 +02:00
futex selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
gpio selftests: gpio-mockup-chardev: Check asprintf() for error 2019-03-05 17:58:48 +01:00
ia64 License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
intel_pstate selftests: intel_pstate: notification about privilege required to run intel_pstate testing script 2018-05-30 21:31:31 -06:00
ipc selftests/ipc: Fix test failure seen after initial test run 2020-05-10 10:30:06 +02:00
kcmp License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kmod selftests: kmod: fix handling test numbers above 9 2020-04-29 16:31:12 +02:00
kvm selftests: kvm: fix build with glibc >= 2.30 2019-12-13 08:51:05 +01:00
lib selftests: lib: fix prime_numbers module search and skip logic 2018-05-30 21:32:55 -06:00
locking selftests: locking: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
media_tests selftests: media_tests: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
membarrier selftests: membarrier: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
memfd UPSTREAM: selftests/memfd: Add tests for F_SEAL_FUTURE_WRITE seal 2019-01-16 09:48:52 -05:00
memory-hotplug selftests: memory-hotplug: add required configs 2018-09-05 10:58:31 -06:00
mount selftests: mount: remove no longer needed config option 2018-08-09 11:26:07 -06:00
mqueue selftests: mqueue: return Kselftest Skip code for skipped tests 2018-05-30 15:29:06 -06:00
net selftests/net: relax cpu affinity requirement in msg_zerocopy test 2020-08-11 15:32:35 +02:00
netfilter selftests: netfilter: missing error check when setting up veth interface 2019-06-22 08:15:15 +02:00
networking/timestamping selftests/net: rxtimestamp: fix clang issues for target arch PowerPC 2020-08-05 10:06:02 +02:00
nsfs tools/testing: Fix trailing semicolon 2018-01-12 11:41:33 -07:00
ntb NTB: ntb_test: Fix bug when counting remote files 2020-06-25 15:33:04 +02:00
powerpc selftests/powerpc: Purge extra count_pmc() calls of ebb selftests 2020-09-03 11:24:20 +02:00
prctl License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
proc selftests: fix warning: "_GNU_SOURCE" redefined 2019-12-01 09:17:00 +01:00
pstore selftests: pstore: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
ptp posix-timers: Prevent UB from shifting negative signed value 2018-01-04 14:57:10 +01:00
ptrace License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rcutorture rcutorture: Change units of onoff_interval to jiffies 2018-07-12 15:42:01 -07:00
rseq rseq/selftests: Turn off timeout setting 2020-01-17 19:47:15 +01:00
rtc selftests: rtc: rtctest: add alarm test on minute boundary 2019-03-05 17:58:47 +01:00
seccomp selftests: skip seccomp get_metadata test if not real root 2019-04-05 22:33:07 +02:00
sigaltstack License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
size kselftest: Minimise dependency of get_size on C library interfaces 2020-02-24 08:34:37 +01:00
sparc64 selftests: sparc64: Add missing SPDX License Identifiers 2018-06-18 09:29:20 -06:00
splice License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
static_keys selftests: static_keys: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
sync selftests: sync: add config fragment for testing sync framework 2018-06-18 09:11:10 -06:00
sysctl selftests: sysctl: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
tc-testing tc-testing: fix build of eBPF programs 2019-11-24 08:20:29 +01:00
timers selftests/timers: Add missing fflush(stdout) calls 2019-06-19 08:18:04 +02:00
uevent selftests: uevent filtering 2018-05-23 15:24:22 -04:00
user selftests: user: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
vDSO selftests: vDSO - fix to return KSFT_SKIP when test couldn't be run 2018-07-11 10:14:26 -06:00
vm selftests: vm: drop dependencies on page flags from mlock2 tests 2020-04-17 10:48:51 +02:00
watchdog selftests: watchdog: Fix error message. 2019-12-01 09:16:59 +01:00
wireguard UPSTREAM: wireguard: device: avoid circular netns references 2020-10-25 13:40:24 +01:00
x86 selftests/x86/syscall_nt: Clear weird flags after each test 2020-10-01 13:14:49 +02:00
zram selftests: zram: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
.gitignore
gen_kselftest_tar.sh selftests: gen_kselftest_tar.h: Add SPDX license identifier 2018-01-12 11:44:31 -07:00
kselftest.h selftests: kselftest: Remove outdated comment 2018-08-27 14:07:46 -06:00
kselftest_harness.h selftests: do not macro-expand failed assertion expressions 2019-01-26 09:32:38 +01:00
kselftest_install.sh selftests: kselftest_install.sh: Add SPDX license identifier 2018-01-12 11:45:05 -07:00
lib.mk selftests: fix too long argument 2020-03-11 14:14:48 +01:00
Makefile selftests: add script to stress-test nft packet path vs. control plane 2018-12-17 09:24:31 +01:00