linux-stable/tools
Martin KaFai Lau c8e8e6f410 bpf, selftests: Fix racing issue in btf_skc_cls_ingress test
[ Upstream commit c2fcbf81c3 ]

The libbpf CI reported occasional failure in btf_skc_cls_ingress:

  test_syncookie:FAIL:Unexpected syncookie states gen_cookie:80326634 recv_cookie:0
  bpf prog error at line 97

"error at line 97" means the bpf prog cannot find the listening socket
when the final ack is received.  It then skipped processing
the syncookie in the final ack which then led to "recv_cookie:0".

The problem is the userspace program did not do accept() and went
ahead to close(listen_fd) before the kernel (and the bpf prog) had
a chance to process the final ack.

The fix is to add accept() call so that the userspace will wait for
the kernel to finish processing the final ack first before close()-ing
everything.

Fixes: 9a856cae22 ("bpf: selftest: Add test_btf_skc_cls_ingress")
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211216191630.466151-1-kafai@fb.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-12-22 09:32:45 +01:00
..
accounting
arch x86/insn: Use get_unaligned() instead of memcpy() 2021-11-18 19:16:30 +01:00
bootconfig tools/bootconfig: Define memblock_free_ptr() to fix build error 2021-09-15 09:49:48 -07:00
bpf bpftool: Avoid leaking the JSON writer prepared for program metadata 2021-11-18 19:16:39 +01:00
build tools build: Remove needless libpython-version feature check that breaks test-all fast path 2021-12-14 10:57:18 +01:00
cgroup tools/cgroup/slabinfo.py: updated to work on current kernel 2021-04-23 14:42:40 -07:00
debugging tools: Fix "the the" in a message in kernel-chktaint 2021-06-13 17:01:17 -06:00
edid
firewire
firmware
gpio
hv
iio
include x86/insn: Use get_unaligned() instead of memcpy() 2021-11-18 19:16:30 +01:00
io_uring tools/io_uring/io_uring-cp: sync with liburing example 2021-08-13 08:58:11 -06:00
kvm/kvm_stat KVM: kvm_stat: do not show halt_wait_ns 2021-10-18 14:07:18 -04:00
laptop
leds
lib libbpf: Fix lookup_and_delete_elem_flags error reporting 2021-11-18 19:17:09 +01:00
memory-model tools/memory-model: Document data_race(READ_ONCE()) 2021-07-27 11:48:55 -07:00
objtool objtool: Handle __sanitize_cov*() tail calls 2021-11-18 19:16:23 +01:00
pci tools: PCI: Zero-initialize param 2021-08-05 11:01:30 +01:00
pcmcia
perf perf inject: Fix itrace space allowed for new attributes 2021-12-17 10:30:16 +01:00
power tools/power/x86/intel-speed-select: v1.10 release 2021-06-18 15:29:32 +02:00
rcu tools/rcu: Add drgn script to dump number of RCU callbacks 2021-05-10 15:39:19 -07:00
scripts tools build: Fix quiet cmd indentation 2021-05-17 12:10:03 +09:00
spi
testing bpf, selftests: Fix racing issue in btf_skc_cls_ingress test 2021-12-22 09:32:45 +01:00
thermal/tmon tools/thermal/tmon: Add cross compiling support 2021-08-14 15:33:19 +02:00
time
tracing tools/latency-collector: Use correct size when writing queue_full_warning 2021-11-18 19:16:19 +01:00
usb usb: testusb: Fix for showing the connection speed 2021-09-14 10:31:41 +02:00
virtio tools/virtio: fix build 2021-08-11 06:44:24 -04:00
vm tools/vm/page-types: remove dependency on opt_file for idle page tracking 2021-09-24 16:13:35 -07:00
wmi
Makefile