linux-stable/tools/testing/selftests
Andrey Ignatov fc396828a4 selftests/bpf: Test [::] -> [::1] rewrite in sys_sendmsg in test_sock_addr
[ Upstream commit 976b4f3a46 ]

Test that sys_sendmsg BPF hook doesn't break sys_sendmsg behaviour to
rewrite destination IPv6 = [::] with [::1] (BSD'ism).

Two test cases are added:

1) User passes dst IPv6 = [::] and BPF_CGROUP_UDP6_SENDMSG program
   doesn't touch it.

2) User passes dst IPv6 != [::], but BPF_CGROUP_UDP6_SENDMSG program
   rewrites it with [::].

In both cases [::1] is used by sys_sendmsg code eventually and datagram
is sent successfully for unconnected UDP socket.

Example of relevant output:
  Test case: sendmsg6: set dst IP = [::] (BSD'ism) .. [PASS]
  Test case: sendmsg6: preserve dst IP = [::] (BSD'ism) .. [PASS]

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-02-27 10:08:52 +01:00
..
android selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
bpf selftests/bpf: Test [::] -> [::1] rewrite in sys_sendmsg in test_sock_addr 2019-02-27 10:08:52 +01:00
breakpoints selftests: breakpoints: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
capabilities
cgroup Add tests for memory.oom.group 2018-09-07 16:36:01 -06:00
cpu-hotplug selftests: cpu-hotplug: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06: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 selftests: filesystems: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
firmware selftests: firmware: return Kselftest Skip code for skipped tests 2018-05-30 15:21:52 -06:00
ftrace selftests/ftrace: Fix synthetic event test to delete event correctly 2018-11-13 11:08:55 -08:00
futex selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
gpio selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
ia64
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: return Kselftest Skip code for skipped tests 2018-05-30 15:21:53 -06:00
kcmp
kmod selftests: kmod: return Kselftest Skip code for skipped tests 2018-05-30 15:21:53 -06:00
kvm selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +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 selftests: memfd: split regular and hugetlbfs tests 2018-05-30 15:29:06 -06: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 net/ipv6: Allow onlink routes to have a device mismatch if it is the default route 2018-11-04 14:50:52 +01:00
netfilter selftests: add script to stress-test nft packet path vs. control plane 2018-12-17 09:24:31 +01:00
networking/timestamping selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
nsfs
ntb
powerpc powerpc/selftests: Wait all threads to join 2018-11-21 09:19:11 +01:00
prctl
proc proc: fixup map_files test on arm 2018-12-17 09:24:41 +01:00
pstore selftests: pstore: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
ptp
ptrace
rcutorture rcutorture: Change units of onoff_interval to jiffies 2018-07-12 15:42:01 -07:00
rseq rseq/selftests: fix parametrized test with -fpie 2018-09-27 12:59:19 -06:00
rtc selftests: rtc: rework rtctest 2018-05-30 15:21:51 -06:00
seccomp selftests/seccomp: Enhance per-arch ptrace syscall skip tests 2019-02-06 17:30:11 +01:00
sigaltstack
size
sparc64 selftests: sparc64: Add missing SPDX License Identifiers 2018-06-18 09:29:20 -06:00
splice
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: tdc.py: Guard against lack of returncode in executed command 2018-12-13 09:16:13 +01:00
timers selftest: timers: Tweak raw_skew to SKIP when ADJ_OFFSET/other clock adjustments are in progress 2018-07-10 12:43:21 -07: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: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
watchdog
x86 x86/selftests/pkeys: Fork() to check for state being preserved 2019-01-31 08:14:39 +01:00
zram selftests: zram: return Kselftest Skip code for skipped tests 2018-06-18 09:11:09 -06:00
.gitignore
gen_kselftest_tar.sh
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
lib.mk selftests: Fix test errors related to lib.mk khdr target 2019-01-22 21:40:38 +01:00
Makefile selftests: add script to stress-test nft packet path vs. control plane 2018-12-17 09:24:31 +01:00