linux/tools/testing/selftests/bpf/prog_tests
Dmitrii Banshchikov f782e2c300 bpf: Relax return code check for subprograms
Currently verifier enforces return code checks for subprograms in the
same manner as it does for program entry points. This prevents returning
arbitrary scalar values from subprograms. Scalar type of returned values
is checked by btf_prepare_func_args() and hence it should be safe to
allow only scalars for now. Relax return code checks for subprograms and
allow any correct scalar values.

Fixes: 51c39bb1d5 (bpf: Introduce function-by-function verification)
Signed-off-by: Dmitrii Banshchikov <me@ubique.spb.ru>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20201113171756.90594-1-me@ubique.spb.ru
2020-11-14 08:17:27 -08:00
..
.gitignore
align.c bpf: Propagate scalar ranges through register assignments. 2020-10-09 22:03:06 +02:00
attach_probe.c
autoload.c
bpf_iter.c selftests/bpf_iter: Don't fail test due to missing __builtin_btf_type_id 2020-09-29 11:18:19 -07:00
bpf_obj_id.c selftest/bpf: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
bpf_tcp_ca.c
bpf_verif_scale.c selftests/bpf: Add subprogs to pyperf, strobemeta, and l4lb_noinline tests 2020-09-03 17:14:40 -07:00
btf.c selftests/bpf: Merge most of test_btf into test_progs 2020-09-15 18:37:33 -07:00
btf_dump.c selftests/bpf: Test "incremental" btf_dump in C format 2020-09-30 12:30:46 -07:00
btf_endian.c selftests/bpf: Test BTF's handling of endianness 2020-09-29 12:21:23 -07:00
btf_map_in_map.c bpf, selftests: Add test for different array inner map size 2020-10-11 10:21:04 -07:00
btf_skc_cls_ingress.c selftests: Make sure all 'skel' variables are declared static 2020-09-29 11:43:43 -07:00
btf_write.c selftests/bpf: Move and extend ASSERT_xxx() testing macros 2020-09-29 12:21:23 -07:00
cg_storage_multi.c selftests/bpf: Don't destroy failed link 2020-07-31 00:43:49 +02:00
cgroup_attach_autodetach.c
cgroup_attach_multi.c
cgroup_attach_override.c
cgroup_link.c selftests/bpf: Add link detach tests for cgroup, netns, and xdp bpf_links 2020-08-01 20:38:28 -07:00
cgroup_skb_sk_lookup.c bpf: selftests: A few improvements to network_helpers.c 2020-07-02 16:09:01 +02:00
cls_redirect.c selftests/bpf: Add __noinline variant of cls_redirect selftest 2020-09-03 17:14:40 -07:00
connect_force_port.c bpf: selftests: A few improvements to network_helpers.c 2020-07-02 16:09:01 +02:00
core_autosize.c selftests/bpf: Validate libbpf's auto-sizing of LD/ST/STX instructions 2020-10-07 18:50:27 -07:00
core_extern.c selftest/bpf: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
core_reloc.c selftests/bpf: Add tests for ENUMVAL_EXISTS/ENUMVAL_VALUE relocations 2020-08-19 14:19:39 -07:00
core_retro.c selftests/bpf: Fix spurious test failures in core_retro selftest 2020-08-01 23:10:42 -07:00
cpu_mask.c
d_path.c selftests/bpf: Fix stat probe in d_path test 2020-09-21 16:18:00 -07:00
enable_stats.c
endian.c selftests/bpf: Add byte swapping selftest 2020-07-01 09:06:12 +02:00
fentry_fexit.c
fentry_test.c
fexit_bpf2bpf.c selftests: Add selftest for disallowing modify_return attachment to freplace 2020-09-29 13:09:24 -07:00
fexit_stress.c
fexit_test.c
flow_dissector.c selftest/bpf: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
flow_dissector_load_bytes.c
flow_dissector_reattach.c
get_stack_raw_tp.c
get_stackid_cannot_attach.c selftests/bpf: Add get_stackid_cannot_attach 2020-07-25 20:16:35 -07:00
global_data.c selftest/bpf: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
global_data_init.c selftests/bpf: Fix check in global_data_init. 2020-09-03 17:33:31 -07:00
hashmap.c
kfree_skb.c
ksyms.c selftests/bpf: Ksyms_btf to test typed ksyms 2020-10-02 14:59:25 -07:00
ksyms_btf.c bpf: selftest: Ensure the return value of the bpf_per_cpu_ptr() must be checked 2020-10-19 15:57:42 -07:00
l4lb_all.c selftests/bpf: Add subprogs to pyperf, strobemeta, and l4lb_noinline tests 2020-09-03 17:14:40 -07:00
link_pinning.c
load_bytes_relative.c bpf: selftests: A few improvements to network_helpers.c 2020-07-02 16:09:01 +02:00
map_init.c bpf: Zero-fill re-used per-cpu map element 2020-11-05 19:55:57 -08:00
map_lock.c
map_ptr.c
metadata.c selftests/bpf: Test load and dump metadata with btftool and skel 2020-09-15 18:28:27 -07:00
mmap.c selftests/bpf: Fix segmentation fault in test_progs 2020-08-11 15:36:45 +02:00
modify_return.c
ns_current_pid_tgid.c
obj_name.c
pe_preserve_elems.c selftests/bpf: Add tests for BPF_F_PRESERVE_ELEMS 2020-09-30 23:21:06 -07:00
perf_branches.c
perf_buffer.c libbpf: Add perf_buffer APIs for better integration with outside epoll loop 2020-08-21 14:26:55 -07:00
perf_event_stackmap.c selftests/bpf: Add callchain_stackid 2020-07-25 20:16:35 -07:00
pinning.c selftest/bpf: Test pinning map with reused map fd 2020-10-06 11:10:20 -07:00
pkt_access.c
pkt_md_access.c
probe_user.c
prog_run_xattr.c selftest/bpf: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
queue_stack_map.c
raw_tp_test_run.c selftests/bpf: Add raw_tp_test_run 2020-09-28 21:52:36 +02:00
raw_tp_writable_reject_nbd_invalid.c
raw_tp_writable_test_run.c
rdonly_maps.c
reference_tracking.c selftests/bpf: Don't use deprecated libbpf APIs 2020-09-03 17:14:40 -07:00
resolve_btfids.c selftests/bpf: Fix alignment of .BTF_ids 2020-09-30 18:11:40 -07:00
ringbuf.c
ringbuf_multi.c
section_names.c libbpf: Add support for BPF XDP link 2020-07-25 20:37:02 -07:00
select_reuseport.c
send_signal.c bpf: Fix compilation warning of selftests 2020-08-06 16:58:42 -07:00
send_signal_sched_switch.c
signal_pending.c
sk_assign.c selftests/bpf: Fix endianness issue in sk_assign 2020-09-18 22:54:52 +02:00
sk_lookup.c selftests/bpf: Fix v4_to_v6 in sk_lookup 2020-08-11 15:36:51 +02:00
skb_ctx.c selftest/bpf: Fix compilation warnings in 32-bit mode 2020-08-13 16:45:41 -07:00
skb_helpers.c
skeleton.c tools/bpftool: Strip away modifiers from global variables 2020-07-13 17:07:43 -07:00
snprintf_btf.c bpf, selftests: Fix warning in snprintf_btf where system() call unchecked 2020-09-29 13:21:23 -07:00
sock_fields.c selftests: Make sure all 'skel' variables are declared static 2020-09-29 11:43:43 -07:00
sockmap_basic.c selftests/bpf: Properly initialize linfo in sockmap_basic 2020-10-02 16:47:32 +02:00
sockmap_ktls.c
sockmap_listen.c
sockopt.c
sockopt_inherit.c selftests/bpf: Fix possible hang in sockopt_inherit 2020-07-16 20:57:09 +02:00
sockopt_multi.c selftests/bpf: test_progs: convert test_sockopt_multi 2019-09-06 09:59:05 -07:00
sockopt_sk.c selftests/bpf: Fix endianness issue in test_sockopt_sk 2020-09-19 01:01:18 +02:00
spinlock.c
stacktrace_build_id.c
stacktrace_build_id_nmi.c bpf: Fix compilation warning of selftests 2020-08-06 16:58:42 -07:00
stacktrace_map.c
stacktrace_map_raw_tp.c
subprogs.c libbpf: Don't attempt to load unused subprog as an entry-point BPF program 2020-11-09 22:15:23 +01:00
tailcalls.c selftests/bpf: Add tailcall_bpf2bpf tests 2020-09-17 19:56:07 -07:00
task_fd_query_rawtp.c
task_fd_query_tp.c
tcp_estats.c
tcp_hdr_options.c bpf, selftest: Fix flaky tcp_hdr_options test when adding addr to lo 2020-10-15 20:53:15 +02:00
tcp_rtt.c bpf: selftests: A few improvements to network_helpers.c 2020-07-02 16:09:01 +02:00
test_bpffs.c selftests/bpf: Add bpffs preload test. 2020-08-20 16:02:36 +02:00
test_global_funcs.c bpf: Relax return code check for subprograms 2020-11-14 08:17:27 -08:00
test_local_storage.c bpf: Add selftests for local_storage 2020-08-25 15:00:04 -07:00
test_lsm.c selftests/bpf: Add sleepable tests 2020-08-28 21:20:33 +02:00
test_overhead.c selftests: Remove fmod_ret from test_overhead 2020-09-28 17:20:28 -07:00
test_profiler.c selftests/bpf: Add profiler test 2020-10-09 22:03:06 +02:00
tp_attach_query.c
trace_ext.c selftests/bpf: Adding test for arg dereference in extension trace 2020-09-29 13:09:24 -07:00
trace_printk.c selftests/bpf: Add selftests verifying bpf_trace_printk() behaviour 2020-07-13 16:55:49 -07:00
trampoline_count.c
udp_limit.c selftests/bpf: Test BPF_CGROUP_INET_SOCK_RELEASE 2020-07-08 01:07:36 +02:00
varlen.c selftests/bpf: Make test_varlen work with 32-bit user-space arch 2020-08-13 16:45:41 -07:00
vmlinux.c
xdp.c
xdp_adjust_tail.c
xdp_attach.c
xdp_bpf2bpf.c
xdp_cpumap_attach.c selftest: Add tests for XDP programs in CPUMAP entries 2020-07-16 17:00:32 +02:00
xdp_devmap_attach.c
xdp_info.c
xdp_link.c selftests/bpf: Add link detach tests for cgroup, netns, and xdp bpf_links 2020-08-01 20:38:28 -07:00
xdp_noinline.c selftests/bpf: Initialize duration in xdp_noinline.c 2020-10-02 16:46:20 +02:00
xdp_perf.c