linux/tools/testing/selftests/bpf/prog_tests
Xu Kuohai a4b7193d8e selftests/bpf: Add sockmap test for redirecting partial skb data
Add a test case to check whether sockmap redirection works correctly
when data length returned by stream_parser is less than skb->len.

In addition, this test checks whether strp_done is called correctly.
The reason is that we returns skb->len - 1 from the stream_parser, so
the last byte in the skb will be held by strp->skb_head. Therefore,
if strp_done is not called to free strp->skb_head, we'll get a memleak
warning.

Signed-off-by: Xu Kuohai <xukuohai@huawei.com>
Link: https://lore.kernel.org/r/20230804073740.194770-5-xukuohai@huaweicloud.com
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
2023-08-09 20:29:02 -07:00
..
.gitignore
access_variable_array.c
align.c
arg_parsing.c
async_stack_depth.c selftests/bpf: Add selftest for check_stack_max_depth bug 2023-07-05 19:14:54 -07:00
atomic_bounds.c
atomics.c
attach_probe.c
autoattach.c
autoload.c
bind_perm.c
bloom_filter_map.c
bpf_cookie.c
bpf_iter.c
bpf_iter_setsockopt.c
bpf_iter_setsockopt_unix.c
bpf_loop.c
bpf_mod_race.c
bpf_nf.c
bpf_obj_id.c
bpf_obj_pinning.c selftests/bpf: Add path_fd-based BPF_OBJ_PIN and BPF_OBJ_GET tests 2023-05-23 23:41:07 +02:00
bpf_tcp_ca.c
bpf_verif_scale.c
btf.c selftests/bpf: Add a test where map key_type_id with decl_tag type 2023-05-30 14:34:46 -07:00
btf_dedup_split.c
btf_dump.c
btf_endian.c selftests/bpf: Store BPF object files with .bpf.o extension 2022-09-02 15:55:37 +02:00
btf_map_in_map.c
btf_module.c
btf_skc_cls_ingress.c
btf_split.c
btf_tag.c
btf_write.c
cb_refs.c
cg_storage_multi.c
cgroup_attach_autodetach.c
cgroup_attach_multi.c
cgroup_attach_override.c
cgroup_getset_retval.c
cgroup_hierarchical_stats.c
cgroup_iter.c
cgroup_link.c
cgroup_skb_sk_lookup.c
cgroup_v1v2.c
cgrp_kfunc.c
cgrp_local_storage.c
check_mtu.c selftests/bpf: Fix check_mtu using wrong variable type 2023-06-06 17:08:22 +02:00
cls_redirect.c
connect_force_port.c
connect_ping.c
core_autosize.c
core_extern.c
core_kern.c
core_kern_overflow.c
core_read_macros.c
core_reloc.c
core_retro.c
cpu_mask.c
cpumask.c selftests/bpf: Add test for new bpf_cpumask_first_and() kfunc 2023-06-12 15:09:11 -07:00
ctx_rewrite.c
custom_sec_handlers.c
d_path.c
decap_sanity.c
deny_namespace.c
dummy_st_ops.c
dynptr.c
empty_skb.c
enable_stats.c
endian.c
exhandler.c selftests/bpf: Add exception handling selftests for tp_bpf program 2021-11-08 22:17:55 +01:00
fentry_fexit.c
fentry_test.c
fexit_bpf2bpf.c
fexit_sleep.c
fexit_stress.c
fexit_test.c selftests/bpf: Migrate from bpf_prog_test_run 2022-02-02 22:31:18 -08:00
fib_lookup.c selftests/bpf: Test table ID fib lookup BPF helper 2023-06-01 19:59:01 +02:00
find_vma.c Improve stability of find_vma BPF test 2022-03-08 17:39:29 -08:00
flow_dissector.c
flow_dissector_load_bytes.c
flow_dissector_reattach.c
for_each.c
get_branch_snapshot.c
get_func_args_test.c
get_func_ip_test.c
get_stack_raw_tp.c
get_stackid_cannot_attach.c
global_data.c
global_data_init.c
global_func_args.c
global_map_resize.c libbpf: Selftests for resizing datasec maps 2023-05-24 11:44:17 -07:00
hash_large_key.c
hashmap.c
helper_restricted.c
htab_reuse.c
htab_update.c
inner_array_lookup.c selftests/bpf: Add access_inner_map selftest 2023-06-02 17:04:22 -07:00
iters.c
jeq_infer_not_null.c
jit_probe_mem.c
kfree_skb.c
kfunc_call.c
kfunc_dynptr_param.c
kprobe_multi_test.c
kprobe_multi_testmod_test.c
ksyms.c
ksyms_btf.c
ksyms_module.c
l4lb_all.c
legacy_printk.c
libbpf_get_fd_by_id_opts.c
libbpf_probes.c
libbpf_str.c selftests/bpf: Fix test test_libbpf_str/bpf_map_type_str 2022-10-25 23:19:19 -07:00
link_pinning.c
linked_funcs.c
linked_list.c
linked_maps.c
linked_vars.c
load_bytes_relative.c
local_kptr_stash.c
log_buf.c
log_fixup.c
lookup_and_delete.c
lookup_key.c
lru_bug.c
lsm_cgroup.c
map_init.c bpf: Zero-fill re-used per-cpu map element 2020-11-05 19:55:57 -08:00
map_kptr.c
map_lock.c
map_lookup_percpu_elem.c
map_ops.c
map_ptr.c
metadata.c
migrate_reuseport.c
mmap.c
modify_return.c
module_attach.c
module_fentry_shadow.c
mptcp.c
nested_trust.c
netcnt.c
netns_cookie.c
ns_current_pid_tgid.c
obj_name.c
parse_tcp_hdr_opt.c
pe_preserve_elems.c
perf_branches.c
perf_buffer.c
perf_event_stackmap.c
perf_link.c
pinning.c
pkt_access.c
pkt_md_access.c
probe_read_user_str.c
probe_user.c
prog_array_init.c
prog_run_opts.c
prog_tests_framework.c
queue_stack_map.c
raw_tp_test_run.c
raw_tp_writable_reject_nbd_invalid.c
raw_tp_writable_test_run.c
rbtree.c
rcu_read_lock.c
rdonly_maps.c
recursion.c
refcounted_kptr.c
reference_tracking.c
resolve_btfids.c
ringbuf.c
ringbuf_multi.c
section_names.c
select_reuseport.c
send_signal.c
send_signal_sched_switch.c
setget_sockopt.c
signal_pending.c selftests/bpf: Migrate from bpf_prog_test_run 2022-02-02 22:31:18 -08:00
sk_assign.c selftests/bpf: Fix sk_assign on s390x 2023-01-29 19:16:28 -08:00
sk_lookup.c
sk_storage_tracing.c
skb_ctx.c selftests/bpf: Store BPF object files with .bpf.o extension 2022-09-02 15:55:37 +02:00
skb_helpers.c selftests/bpf: Store BPF object files with .bpf.o extension 2022-09-02 15:55:37 +02:00
skb_load_bytes.c
skc_to_unix_sock.c
skeleton.c
snprintf.c
snprintf_btf.c selfetest/bpf: Make some tests serial 2021-10-08 15:17:00 -07:00
sock_destroy.c
sock_fields.c
socket_cookie.c
sockmap_basic.c bpf, sockmap: Test FIONREAD returns correct bytes in rx buffer with drops 2023-05-23 16:11:20 +02:00
sockmap_helpers.h bpf, sockmap: Build helper to create connected socket pair 2023-05-23 16:10:58 +02:00
sockmap_ktls.c
sockmap_listen.c selftests/bpf: Add sockmap test for redirecting partial skb data 2023-08-09 20:29:02 -07:00
sockopt.c selftests/bpf: Check whether to run selftest 2023-05-25 16:51:05 -07:00
sockopt_inherit.c
sockopt_multi.c
sockopt_qos_to_cc.c
sockopt_sk.c selftests/bpf: Fix sockopt_sk selftest 2023-06-06 11:07:26 -07:00
spin_lock.c
stack_var_off.c
stacktrace_build_id.c
stacktrace_build_id_nmi.c
stacktrace_map.c
stacktrace_map_raw_tp.c
stacktrace_map_skip.c
static_linked.c
subprogs.c selftests/bpf: Test subprog jit when toggle bpf_jit_harden repeatedly 2022-03-16 15:13:36 -07:00
subprogs_extable.c selftests/bpf: add a test for subprogram extables 2023-06-13 15:13:52 -07:00
subskeleton.c
syscall.c
tailcalls.c
task_fd_query_rawtp.c
task_fd_query_tp.c
task_kfunc.c
task_local_storage.c
task_pt_regs.c
task_under_cgroup.c
tc_bpf.c
tc_redirect.c
tcp_estats.c
tcp_hdr_options.c
tcp_rtt.c
tcpbpf_user.c
test_bpf_syscall_macro.c
test_bpffs.c
test_bprm_opts.c
test_global_funcs.c
test_ima.c
test_local_storage.c
test_lsm.c
test_overhead.c
test_profiler.c
test_skb_pkt_end.c
test_strncmp.c
test_tunnel.c
time_tai.c
timer.c
timer_crash.c
timer_mim.c
tp_attach_query.c
trace_ext.c
trace_printk.c
trace_vprintk.c
tracing_struct.c
trampoline_count.c
type_cast.c
udp_limit.c
uninit_stack.c
unpriv_bpf_disabled.c bpf: Centralize permissions checks for all BPF map types 2023-06-19 14:04:04 +02:00
uprobe_autoattach.c
usdt.c
user_ringbuf.c
varlen.c
verif_stats.c
verifier.c selftests/bpf: Check if mark_chain_precision() follows scalar ids 2023-06-13 15:14:27 -07:00
verifier_log.c
verify_pkcs7_sig.c
vmlinux.c
vrf_socket_lookup.c selftests/bpf: Add vrf_socket_lookup tests 2023-06-21 23:48:51 +02:00
xdp.c
xdp_adjust_frags.c
xdp_adjust_tail.c
xdp_attach.c
xdp_bonding.c selftests/bpf: Add xdp_feature selftest for bond device 2023-05-23 16:22:25 +02:00
xdp_bpf2bpf.c
xdp_context_test_run.c
xdp_cpumap_attach.c
xdp_devmap_attach.c
xdp_do_redirect.c
xdp_info.c
xdp_link.c
xdp_metadata.c
xdp_noinline.c
xdp_perf.c
xdp_synproxy.c
xdpwall.c
xfrm_info.c