linux/tools/testing/selftests/bpf/progs
Petar Penkov 9840a4ffcf selftests/bpf: fix race in flow dissector tests
Since the "last_dissection" map holds only the flow keys for the most
recent packet, there is a small race in the skb-less flow dissector
tests if a new packet comes between transmitting the test packet, and
reading its keys from the map. If this happens, the test packet keys
will be overwritten and the test will fail.

Changing the "last_dissection" map to a hash map, keyed on the
source/dest port pair resolves this issue. Additionally, let's clear the
last test results from the map between tests to prevent previous test
cases from interfering with the following test cases.

Fixes: 0905beec9f ("selftests/bpf: run flow dissector tests in skb-less mode")
Signed-off-by: Petar Penkov <ppenkov@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2019-08-13 16:31:10 +02:00
..
bpf_flow.c selftests/bpf: fix race in flow dissector tests 2019-08-13 16:31:10 +02:00
btf__core_reloc_arrays___diff_arr_dim.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays___diff_arr_val_sz.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays___err_non_array.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays___err_too_shallow.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays___err_too_small.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays___err_wrong_val_type1.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays___err_wrong_val_type2.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_arrays.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_flavors__err_wrong_name.c selftests/bpf: add CO-RE relocs struct flavors tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_flavors.c selftests/bpf: add CO-RE relocs struct flavors tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___bool.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___err_bitfield.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___err_wrong_sz_8.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___err_wrong_sz_16.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___err_wrong_sz_32.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___err_wrong_sz_64.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints___reverse_sign.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ints.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_misc.c selftests/bpf: add CO-RE relocs misc tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_mods___mod_swap.c selftests/bpf: add CO-RE relocs modifiers/typedef tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_mods___typedefs.c selftests/bpf: add CO-RE relocs modifiers/typedef tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_mods.c selftests/bpf: add CO-RE relocs modifiers/typedef tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___anon_embed.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___dup_compat_types.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_array_container.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_array_field.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_dup_incompat_types.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_missing_container.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_missing_field.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_nonstruct_container.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_partial_match_dups.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___err_too_deep.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___extra_nesting.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting___struct_union_mixup.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_nesting.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives___diff_enum_def.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives___diff_func_proto.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives___diff_ptr_type.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives___err_non_enum.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives___err_non_int.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives___err_non_ptr.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_primitives.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ptr_as_arr___diff_sz.c selftests/bpf: add CO-RE relocs ptr-as-array tests 2019-08-07 14:43:49 -07:00
btf__core_reloc_ptr_as_arr.c selftests/bpf: add CO-RE relocs ptr-as-array tests 2019-08-07 14:43:49 -07:00
btf_dump_test_case_bitfields.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
btf_dump_test_case_multidim.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
btf_dump_test_case_namespacing.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
btf_dump_test_case_ordering.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
btf_dump_test_case_packing.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
btf_dump_test_case_padding.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
btf_dump_test_case_syntax.c selftests/bpf: add btf_dump BTF-to-C conversion tests 2019-05-24 14:05:58 -07:00
connect4_prog.c
connect6_prog.c
core_reloc_types.h tools/bpf: fix core_reloc.c compilation error 2019-08-07 18:24:03 -07:00
dev_cgroup.c
get_cgroup_id_kern.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
loop1.c selftests/bpf: fix compiling loop{1, 2, 3}.c on s390 2019-07-12 15:38:23 +02:00
loop2.c selftests/bpf: fix compiling loop{1, 2, 3}.c on s390 2019-07-12 15:38:23 +02:00
loop3.c selftests/bpf: fix compiling loop{1, 2, 3}.c on s390 2019-07-12 15:38:23 +02:00
loop4.c selftests/bpf: add loop test 4 2019-08-06 08:20:25 -07:00
loop5.c selftests/bpf: add loop test 5 2019-08-06 08:20:31 -07:00
netcnt_prog.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
pyperf50.c selftests/bpf: add pyperf scale test 2019-05-23 16:20:57 +02:00
pyperf100.c selftests/bpf: add pyperf scale test 2019-05-23 16:20:57 +02:00
pyperf180.c selftests/bpf: add pyperf scale test 2019-05-23 16:20:57 +02:00
pyperf600_nounroll.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
pyperf600.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
pyperf.h selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
sample_map_ret0.c
sample_ret0.c
sendmsg4_prog.c
sendmsg6_prog.c
socket_cookie_prog.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
sockmap_parse_prog.c selftests/bpf: remove bpf_util.h from BPF C progs 2019-06-11 10:36:02 +02:00
sockmap_tcp_msg_prog.c selftests/bpf: remove bpf_util.h from BPF C progs 2019-06-11 10:36:02 +02:00
sockmap_verdict_prog.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
sockopt_multi.c selftests/bpf: add sockopt test that exercises BPF_F_ALLOW_MULTI 2019-06-27 15:25:17 -07:00
sockopt_sk.c selftests/bpf: extend sockopt_sk selftest with TCP_CONGESTION use case 2019-08-01 13:55:52 -07:00
strobemeta_nounroll1.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
strobemeta_nounroll2.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
strobemeta.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
strobemeta.h selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
tcp_rtt.c selftests/bpf: test BPF_SOCK_OPS_RTT_CB 2019-07-03 16:52:02 +02:00
test_adjust_tail.c
test_attach_probe.c selftests/bpf: fix test_attach_probe map definition 2019-07-08 16:25:58 +02:00
test_btf_haskv.c
test_btf_newkv.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_btf_nokv.c
test_core_reloc_arrays.c selftests/bpf: add CO-RE relocs array tests 2019-08-07 14:43:49 -07:00
test_core_reloc_flavors.c selftests/bpf: add CO-RE relocs struct flavors tests 2019-08-07 14:43:49 -07:00
test_core_reloc_ints.c selftests/bpf: add CO-RE relocs ints tests 2019-08-07 14:43:49 -07:00
test_core_reloc_kernel.c selftests/bpf: add CO-RE relocs testing setup 2019-08-07 14:43:49 -07:00
test_core_reloc_misc.c selftests/bpf: add CO-RE relocs misc tests 2019-08-07 14:43:49 -07:00
test_core_reloc_mods.c selftests/bpf: add CO-RE relocs modifiers/typedef tests 2019-08-07 14:43:49 -07:00
test_core_reloc_nesting.c selftests/bpf: add CO-RE relocs nesting tests 2019-08-07 14:43:49 -07:00
test_core_reloc_primitives.c selftests/bpf: add CO-RE relocs enum/ptr/func_proto tests 2019-08-07 14:43:49 -07:00
test_core_reloc_ptr_as_arr.c selftests/bpf: add CO-RE relocs ptr-as-array tests 2019-08-07 14:43:49 -07:00
test_get_stack_rawtp.c selftests/bpf: convert test_get_stack_raw_tp to perf_buffer API 2019-07-23 16:05:42 -07:00
test_global_data.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_jhash.h selftests: bpf: standardize to static __always_inline 2019-07-03 15:06:33 +02:00
test_l4lb_noinline.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_l4lb.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_lirc_mode2_kern.c
test_lwt_ip_encap.c
test_lwt_seg6local.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2019-07-08 19:48:57 -07:00
test_map_in_map.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
test_map_lock.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_obj_id.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
test_perf_buffer.c selftests/bpf: test perf buffer API 2019-07-08 15:35:43 +02:00
test_pkt_access.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206 2019-05-30 11:29:53 -07:00
test_pkt_md_access.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 206 2019-05-30 11:29:53 -07:00
test_queue_map.c
test_seg6_loop.c selftests: bpf: standardize to static __always_inline 2019-07-03 15:06:33 +02:00
test_select_reuseport_kern.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_send_signal_kern.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_sk_lookup_kern.c
test_skb_cgroup_id_kern.c
test_skb_ctx.c selftests: bpf: add selftest for __sk_buff context in BPF_PROG_TEST_RUN 2019-04-11 10:21:41 +02:00
test_sock_fields_kern.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_sockhash_kern.c
test_sockmap_kern.c
test_spin_lock.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_stack_map.c
test_stacktrace_build_id.c selftests/bpf: use typedef'ed arrays as map values 2019-07-15 23:02:17 +02:00
test_stacktrace_map.c selftests/bpf: use typedef'ed arrays as map values 2019-07-15 23:02:17 +02:00
test_sysctl_loop1.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
test_sysctl_loop2.c selftests/bpf: add realistic loop tests 2019-06-19 02:22:52 +02:00
test_sysctl_prog.c selftests/bpf: remove bpf_util.h from BPF C progs 2019-06-11 10:36:02 +02:00
test_tc_edt.c selftests: bpf: tc-bpf flow shaping with EDT 2019-03-22 18:16:44 -07:00
test_tc_tunnel.c selftests/bpf: expand test_tc_tunnel with SIT encap 2019-04-24 01:32:26 +02:00
test_tcp_check_syncookie_kern.c selftests/bpf: add test for bpf_tcp_gen_syncookie 2019-07-30 21:03:05 -07:00
test_tcp_estats.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_tcpbpf_kern.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_tcpnotify_kern.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
test_tracepoint.c
test_tunnel_kern.c
test_verif_scale1.c selftests/bpf: add few verifier scale tests 2019-04-04 01:27:38 +02:00
test_verif_scale2.c selftests: bpf: standardize to static __always_inline 2019-07-03 15:06:33 +02:00
test_verif_scale3.c selftests/bpf: add few verifier scale tests 2019-04-04 01:27:38 +02:00
test_xdp_loop.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
test_xdp_meta.c
test_xdp_noinline.c selftests/bpf: fix test_xdp_noinline on s390 2019-07-18 13:54:54 -07:00
test_xdp_redirect.c
test_xdp_vlan.c
test_xdp.c selftests/bpf: convert selftests using BTF-defined maps to new syntax 2019-07-05 22:52:25 +02:00
xdp_dummy.c
xdp_redirect_map.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00
xdp_tx.c selftests, bpf: Add test for veth native XDP 2019-06-24 18:18:30 -07:00
xdping_kern.c selftests/bpf: convert legacy BPF maps to BTF-defined ones 2019-07-05 22:52:25 +02:00