WSL2-Linux-Kernel/tools/testing/selftests
Yonghong Song 34d67ecf3d selftests/bpf: Fix sockopt_sk selftest
[ Upstream commit 69844e335d ]

Commit f4e4534850 ("net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report")
fixed NETLINK_LIST_MEMBERSHIPS length report which caused
selftest sockopt_sk failure. The failure log looks like

  test_sockopt_sk:PASS:join_cgroup /sockopt_sk 0 nsec
  run_test:PASS:skel_load 0 nsec
  run_test:PASS:setsockopt_link 0 nsec
  run_test:PASS:getsockopt_link 0 nsec
  getsetsockopt:FAIL:Unexpected NETLINK_LIST_MEMBERSHIPS value unexpected Unexpected NETLINK_LIST_MEMBERSHIPS value: actual 8 != expected 4
  run_test:PASS:getsetsockopt 0 nsec
  #201     sockopt_sk:FAIL

In net/netlink/af_netlink.c, function netlink_getsockopt(), for NETLINK_LIST_MEMBERSHIPS,
nlk->ngroups equals to 36. Before Commit f4e4534850, the optlen is calculated as
  ALIGN(nlk->ngroups / 8, sizeof(u32)) = 4
After that commit, the optlen is
  ALIGN(BITS_TO_BYTES(nlk->ngroups), sizeof(u32)) = 8

Fix the test by setting the expected optlen to be 8.

Fixes: f4e4534850 ("net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20230606172202.1606249-1-yhs@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-06-14 11:13:02 +02:00
..
arm64 kselftest/arm64: Fix validatation termination record after EXTRA_CONTEXT 2022-10-26 12:35:44 +02:00
bpf selftests/bpf: Fix sockopt_sk selftest 2023-06-14 11:13:02 +02:00
breakpoints
capabilities
cgroup kseltest/cgroup: Make test_stress.sh work if run interactively 2022-06-09 10:23:30 +02:00
clone3 selftests: fixup build warnings in pidfd / clone3 tests 2022-02-23 12:03:18 +01:00
core selftests/core: fix conflicting types compile error for close_range() 2021-11-18 19:16:21 +01:00
cpu-hotplug
cpufreq selftests/cpufreq: Rename DEBUG_PI_LIST to DEBUG_PLIST 2021-08-31 11:00:02 -06:00
damon selftests/damon: test debugfs file reads/writes with huge count 2021-12-22 09:32:51 +01:00
dma
dmabuf-heaps
drivers sefltests: netdevsim: wait for devlink instance after netns removal 2023-03-10 09:39:19 +01:00
efivarfs selftests/efivarfs: Add checking of the test return value 2022-12-31 13:14:02 +01:00
exec selftests/exec: Add non-regular to TEST_GEN_PROGS 2022-02-23 12:03:13 +01:00
filesystems selftests/binderfs: add test for feature files 2021-07-21 13:46:36 +02:00
firmware selftests: firmware: Fix ignored return val of asprintf() warn 2021-07-21 16:11:42 +02:00
fpu
ftrace selftests/ftrace: Fix bash specific "==" operator 2023-03-10 09:39:33 +01:00
futex selftests/futex: fix build for clang 2022-11-26 09:24:30 +01:00
gpio selftests: gpio: fix gpio compiling error 2021-11-25 09:48:34 +01:00
ia64
intel_pstate selftests/intel_pstate: fix build for ARCH=x86_64 2022-11-26 09:24:30 +01:00
ipc
ir
kcmp
kexec
kmod
kselftest selftests/kselftest/runner/run_one(): allow running non-executable files 2023-05-01 08:23:23 +09:00
kvm selftests: kvm: Fix a compile error in selftests/kvm/rseq_test.c 2023-01-18 11:48:47 +01:00
landlock selftests/landlock: Test ptrace as much as possible with Yama 2023-03-10 09:39:59 +01:00
lib selftests: lib: Add wrapper script for test_scanf 2021-05-19 15:05:11 +02:00
livepatch
lkdtm selftest/lkdtm: Skip stack-entropy test if lkdtm is not available 2023-02-22 12:57:07 +01:00
locking
media_tests
membarrier
memfd selftests/memfd: Fix unknown type name build failure 2023-05-30 13:55:30 +01:00
memory-hotplug selftests: memory-hotplug: avoid spamming logs with dump_page(), ratio limit hot-remove error test 2021-07-12 14:20:01 -06:00
mincore selftests: skip mincore.check_file_mmap when fs lacks needed support 2022-02-23 12:03:05 +01:00
mount
mount_setattr selftests mount: Fix mount_setattr_test builds failed 2023-05-11 23:00:15 +09:00
move_mount_set_group tests: add move_mount(MOVE_MOUNT_SET_GROUP) selftest 2021-07-26 14:45:19 +02:00
mqueue testing/selftests/mqueue: Fix mq_perf_tests to free the allocated cpu set 2022-04-20 09:34:12 +02:00
nci selftests: nci: replace unsigned int with int 2021-09-16 13:55:51 +01:00
net selftests: mptcp: join: skip if MPTCP is not supported 2023-06-09 10:32:35 +02:00
netfilter selftests: nft_nat: ensuring the listening side is up before starting the client 2023-03-17 08:48:54 +01:00
nsfs
ntb
openat2 selftests: openat2: Skip testcases that fail with EOPNOTSUPP 2022-02-23 12:03:05 +01:00
perf_events
pid_namespace
pidfd selftests: fixup build warnings in pidfd / clone3 tests 2022-02-23 12:03:18 +01:00
powerpc selftests/powerpc: Fix resource leaks 2022-12-31 13:14:35 +01:00
prctl
proc proc: fixup uptime selftest 2022-12-31 13:14:02 +01:00
pstore
ptp
ptrace
rcutorture torture: Make torture.sh help message match reality 2022-04-08 14:24:16 +02:00
resctrl selftests/resctrl: Check for return value after write_schemata() 2023-05-11 23:00:19 +09:00
rlimits
rseq selftests/rseq: Change type of rseq_offset to ptrdiff_t 2022-07-07 17:53:31 +02:00
rtc selftests: rtc: Increase test timeout so that all tests run 2022-02-23 12:03:04 +01:00
safesetid selftests: safesetid: Fix spelling mistake "cant" -> "can't" 2021-08-26 15:15:24 -06:00
sched kselftests/sched: cleanup the child processes 2021-11-18 19:16:14 +01:00
seccomp selftests/seccomp: Fix compile warning when CC=clang 2022-08-17 14:23:14 +02:00
sgx selftests/sgx: Treat CC as one argument 2022-04-08 14:23:06 +02:00
sigaltstack selftests: sigaltstack: fix -Wuninitialized 2023-04-26 13:51:50 +02:00
size
sparc64
splice selftests: splice: Adjust for handler fallback removal 2021-06-07 18:39:43 -06:00
static_keys
sync selftests/sync: Remove the deprecated config SYNC 2021-08-31 10:58:00 -06:00
syscall_user_dispatch
sysctl
tc-testing tc-testing: Add control-plane selftests for sch_mq 2021-08-04 12:42:27 +01:00
timens
timers selftests: timers: clocksource-switch: fix passing errors from child 2022-08-17 14:23:30 +02:00
tmpfs
tpm2 selftest: tpm2: Add Client.__del__() to close /dev/tpm* handle 2022-10-26 12:35:29 +02:00
uevent
user
vDSO kselftest: Fix vdso_test_abi return status 2022-02-23 12:03:06 +01:00
vm selftests/vm: remove ARRAY_SIZE define from individual tests 2023-02-06 07:59:01 +01:00
watchdog
wireguard wireguard: device: reset peer src endpoint when netns exits 2021-12-08 09:04:46 +01:00
x86 selftests, x86: fix how check_cc.sh is being invoked 2022-04-08 14:23:11 +02:00
zram selftests/zram: Adapt the situation that /dev/zram0 is being used 2022-02-23 12:03:05 +01:00
.gitignore
Makefile selftests: set the BUILD variable to absolute path 2023-01-12 11:59:19 +01:00
gen_kselftest_tar.sh
kselftest.h selftests: Provide local define of __cpuid_count() 2023-02-06 07:59:01 +01:00
kselftest_deps.sh
kselftest_harness.h tools: fix ARRAY_SIZE defines in tools and selftests hdrs 2023-02-06 07:59:01 +01:00
kselftest_install.sh
kselftest_module.h
lib.mk selftests: Use optional USERCFLAGS and USERLDFLAGS 2023-01-12 11:58:51 +01:00
run_kselftest.sh