summaryrefslogtreecommitdiffstats
path: root/lib/libbpf/ci/vmtest
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libbpf/ci/vmtest')
-rw-r--r--lib/libbpf/ci/vmtest/configs/ALLOWLIST-4.9.08
-rw-r--r--lib/libbpf/ci/vmtest/configs/ALLOWLIST-5.5.055
-rw-r--r--lib/libbpf/ci/vmtest/configs/DENYLIST-5.5.0118
-rw-r--r--lib/libbpf/ci/vmtest/configs/DENYLIST-latest6
-rw-r--r--lib/libbpf/ci/vmtest/configs/DENYLIST-latest.s390x68
-rwxr-xr-xlib/libbpf/ci/vmtest/helpers.sh36
-rwxr-xr-xlib/libbpf/ci/vmtest/run_selftests.sh76
7 files changed, 367 insertions, 0 deletions
diff --git a/lib/libbpf/ci/vmtest/configs/ALLOWLIST-4.9.0 b/lib/libbpf/ci/vmtest/configs/ALLOWLIST-4.9.0
new file mode 100644
index 0000000..ee0d3db
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/configs/ALLOWLIST-4.9.0
@@ -0,0 +1,8 @@
+# btf_dump -- need to disable data dump sub-tests
+core_retro
+cpu_mask
+hashmap
+legacy_printk
+perf_buffer
+section_names
+
diff --git a/lib/libbpf/ci/vmtest/configs/ALLOWLIST-5.5.0 b/lib/libbpf/ci/vmtest/configs/ALLOWLIST-5.5.0
new file mode 100644
index 0000000..87f72f9
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/configs/ALLOWLIST-5.5.0
@@ -0,0 +1,55 @@
+# attach_probe
+autoload
+bpf_verif_scale
+cgroup_attach_autodetach
+cgroup_attach_override
+core_autosize
+core_extern
+core_read_macros
+core_reloc
+core_retro
+cpu_mask
+endian
+get_branch_snapshot
+get_stackid_cannot_attach
+global_data
+global_data_init
+global_func_args
+hashmap
+l4lb_all
+legacy_printk
+linked_funcs
+linked_maps
+map_lock
+obj_name
+perf_buffer
+perf_event_stackmap
+pinning
+pkt_md_access
+probe_user
+queue_stack_map
+raw_tp_writable_reject_nbd_invalid
+raw_tp_writable_test_run
+rdonly_maps
+section_names
+signal_pending
+skeleton
+sockmap_ktls
+sockopt
+sockopt_inherit
+sockopt_multi
+spinlock
+stacktrace_map
+stacktrace_map_raw_tp
+static_linked
+task_fd_query_rawtp
+task_fd_query_tp
+tc_bpf
+tcp_estats
+tcp_rtt
+tp_attach_query
+usdt/urand_pid_attach
+xdp
+xdp_info
+xdp_noinline
+xdp_perf
diff --git a/lib/libbpf/ci/vmtest/configs/DENYLIST-5.5.0 b/lib/libbpf/ci/vmtest/configs/DENYLIST-5.5.0
new file mode 100644
index 0000000..d32b52f
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/configs/DENYLIST-5.5.0
@@ -0,0 +1,118 @@
+# This file is not used and is there for historic purposes only.
+# See WHITELIST-5.5.0 instead.
+
+# PERMANENTLY DISABLED
+align # verifier output format changed
+atomics # new atomic operations (v5.12+)
+atomic_bounds # new atomic operations (v5.12+)
+bind_perm # changed semantics of return values (v5.12+)
+bpf_cookie # 5.15+
+bpf_iter # bpf_iter support is missing
+bpf_obj_id # bpf_link support missing for GET_OBJ_INFO, GET_FD_BY_ID, etc
+bpf_tcp_ca # STRUCT_OPS is missing
+btf_map_in_map # inner map leak fixed in 5.8
+btf_skc_cls_ingress # v5.10+ functionality
+cg_storage_multi # v5.9+ functionality
+cgroup_attach_multi # BPF_F_REPLACE_PROG missing
+cgroup_link # LINK_CREATE is missing
+cgroup_skb_sk_lookup # bpf_sk_lookup_tcp() helper is missing
+check_mtu # missing BPF helper (v5.12+)
+cls_redirect # bpf_csum_level() helper is missing
+connect_force_port # cgroup/get{peer,sock}name{4,6} support is missing
+d_path # v5.10+ feature
+enable_stats # BPF_ENABLE_STATS support is missing
+fentry_fexit # bpf_prog_test_tracing missing
+fentry_test # bpf_prog_test_tracing missing
+fexit_bpf2bpf # freplace is missing
+fexit_sleep # relies on bpf_trampoline fix in 5.12+
+fexit_test # bpf_prog_test_tracing missing
+flow_dissector # bpf_link-based flow dissector is in 5.8+
+flow_dissector_reattach
+for_each # v5.12+
+get_func_ip_test # v5.15+
+get_stack_raw_tp # exercising BPF verifier bug causing infinite loop
+hash_large_key # v5.11+
+ima # v5.11+
+kfree_skb # 32-bit pointer arith in test_pkt_access
+ksyms # __start_BTF has different name
+kfunc_call # v5.13+
+link_pinning # bpf_link is missing
+linked_vars # v5.13+
+load_bytes_relative # new functionality in 5.8
+lookup_and_delete # v5.14+
+map_init # per-CPU LRU missing
+map_ptr # test uses BPF_MAP_TYPE_RINGBUF, added in 5.8
+metadata # v5.10+
+migrate_reuseport # v5.14+
+mmap # 5.5 kernel is too permissive with re-mmaping
+modify_return # fmod_ret support is missing
+module_attach # module BTF support missing (v5.11+)
+netcnt
+netns_cookie # v5.15+
+ns_current_pid_tgid # bpf_get_ns_current_pid_tgid() helper is missing
+pe_preserve_elems # v5.10+
+perf_branches # bpf_read_branch_records() helper is missing
+perf_link # v5.15+
+pkt_access # 32-bit pointer arith in test_pkt_access
+probe_read_user_str # kernel bug with garbage bytes at the end
+prog_run_xattr # 32-bit pointer arith in test_pkt_access
+raw_tp_test_run # v5.10+
+recursion # v5.12+
+ringbuf # BPF_MAP_TYPE_RINGBUF is supported in 5.8+
+
+# bug in verifier w/ tracking references
+#reference_tracking/classifier/sk_lookup_success
+reference_tracking
+
+select_reuseport # UDP support is missing
+send_signal # bpf_send_signal_thread() helper is missing
+sk_assign # bpf_sk_assign helper missing
+sk_lookup # v5.9+
+sk_storage_tracing # missing bpf_sk_storage_get() helper
+skb_ctx # ctx_{size, }_{in, out} in BPF_PROG_TEST_RUN is missing
+skb_helpers # helpers added in 5.8+
+skeleton # creates too big ARRAY map
+snprintf # v5.13+
+snprintf_btf # v5.10+
+sock_fields # v5.10+
+socket_cookie # v5.12+
+sockmap_basic # uses new socket fields, 5.8+
+sockmap_listen # no listen socket supportin SOCKMAP
+sockopt_sk
+sockopt_qos_to_cc # v5.15+
+stacktrace_build_id # v5.9+
+stack_var_off # v5.12+
+syscall # v5.14+
+task_local_storage # v5.12+
+task_pt_regs # v5.15+
+tcp_hdr_options # v5.10+, new TCP header options feature in BPF
+tcpbpf_user # LINK_CREATE is missing
+tc_redirect # v5.14+
+test_bpffs # v5.10+, new CONFIG_BPF_PRELOAD=y and CONFIG_BPF_PRELOAD_UMG=y|m
+test_bprm_opts # v5.11+
+test_global_funcs # kernel doesn't support BTF linkage=global on FUNCs
+test_local_storage # v5.10+ feature
+test_lsm # no BPF_LSM support
+test_overhead # no fmod_ret support
+test_profiler # needs verifier logic improvements from v5.10+
+test_skb_pkt_end # v5.11+
+timer # v5.15+
+timer_mim # v5.15+
+trace_ext # v5.10+
+trace_printk # v5.14+
+trampoline_count # v5.12+ have lower allowed limits
+udp_limit # no cgroup/sock_release BPF program type (5.9+)
+varlen # verifier bug fixed in later kernels
+vmlinux # hrtimer_nanosleep() signature changed incompatibly
+xdp_adjust_tail # new XDP functionality added in 5.8
+xdp_attach # IFLA_XDP_EXPECTED_FD support is missing
+xdp_bonding # v5.15+
+xdp_bpf2bpf # freplace is missing
+xdp_context_test_run # v5.15+
+xdp_cpumap_attach # v5.9+
+xdp_devmap_attach # new feature in 5.8
+xdp_link # v5.9+
+
+# SUBTESTS FAILING (block entire test until blocking subtests works properly)
+btf # "size check test", "func (Non zero vlen)"
+tailcalls # tailcall_bpf2bpf_1, tailcall_bpf2bpf_2, tailcall_bpf2bpf_3
diff --git a/lib/libbpf/ci/vmtest/configs/DENYLIST-latest b/lib/libbpf/ci/vmtest/configs/DENYLIST-latest
new file mode 100644
index 0000000..939de57
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/configs/DENYLIST-latest
@@ -0,0 +1,6 @@
+# TEMPORARY
+get_stack_raw_tp # spams with kernel warnings until next bpf -> bpf-next merge
+stacktrace_build_id_nmi
+stacktrace_build_id
+task_fd_query_rawtp
+varlen
diff --git a/lib/libbpf/ci/vmtest/configs/DENYLIST-latest.s390x b/lib/libbpf/ci/vmtest/configs/DENYLIST-latest.s390x
new file mode 100644
index 0000000..3b16f2d
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/configs/DENYLIST-latest.s390x
@@ -0,0 +1,68 @@
+# TEMPORARY
+atomics # attach(add): actual -524 <= expected 0 (trampoline)
+bpf_iter_setsockopt # JIT does not support calling kernel function (kfunc)
+bloom_filter_map # failed to find kernel BTF type ID of '__x64_sys_getpgid': -3 (?)
+bpf_tcp_ca # JIT does not support calling kernel function (kfunc)
+bpf_loop # attaches to __x64_sys_nanosleep
+bpf_mod_race # BPF trampoline
+bpf_nf # JIT does not support calling kernel function
+core_read_macros # unknown func bpf_probe_read#4 (overlapping)
+d_path # failed to auto-attach program 'prog_stat': -524 (trampoline)
+dummy_st_ops # test_run unexpected error: -524 (errno 524) (trampoline)
+fentry_fexit # fentry attach failed: -524 (trampoline)
+fentry_test # fentry_first_attach unexpected error: -524 (trampoline)
+fexit_bpf2bpf # freplace_attach_trace unexpected error: -524 (trampoline)
+fexit_sleep # fexit_skel_load fexit skeleton failed (trampoline)
+fexit_stress # fexit attach failed prog 0 failed: -524 (trampoline)
+fexit_test # fexit_first_attach unexpected error: -524 (trampoline)
+get_func_args_test # trampoline
+get_func_ip_test # get_func_ip_test__attach unexpected error: -524 (trampoline)
+get_stack_raw_tp # user_stack corrupted user stack (no backchain userspace)
+kfree_skb # attach fentry unexpected error: -524 (trampoline)
+kfunc_call # 'bpf_prog_active': not found in kernel BTF (?)
+ksyms_module # test_ksyms_module__open_and_load unexpected error: -9 (?)
+ksyms_module_libbpf # JIT does not support calling kernel function (kfunc)
+ksyms_module_lskel # test_ksyms_module_lskel__open_and_load unexpected error: -9 (?)
+modify_return # modify_return attach failed: -524 (trampoline)
+module_attach # skel_attach skeleton attach failed: -524 (trampoline)
+mptcp
+kprobe_multi_test # relies on fentry
+netcnt # failed to load BPF skeleton 'netcnt_prog': -7 (?)
+probe_user # check_kprobe_res wrong kprobe res from probe read (?)
+recursion # skel_attach unexpected error: -524 (trampoline)
+ringbuf # skel_load skeleton load failed (?)
+sk_assign # Can't read on server: Invalid argument (?)
+sk_lookup # endianness problem
+sk_storage_tracing # test_sk_storage_tracing__attach unexpected error: -524 (trampoline)
+skc_to_unix_sock # could not attach BPF object unexpected error: -524 (trampoline)
+socket_cookie # prog_attach unexpected error: -524 (trampoline)
+stacktrace_build_id # compare_map_keys stackid_hmap vs. stackmap err -2 errno 2 (?)
+tailcalls # tail_calls are not allowed in non-JITed programs with bpf-to-bpf calls (?)
+task_local_storage # failed to auto-attach program 'trace_exit_creds': -524 (trampoline)
+test_bpffs # bpffs test failed 255 (iterator)
+test_bprm_opts # failed to auto-attach program 'secure_exec': -524 (trampoline)
+test_ima # failed to auto-attach program 'ima': -524 (trampoline)
+test_local_storage # failed to auto-attach program 'unlink_hook': -524 (trampoline)
+test_lsm # failed to find kernel BTF type ID of '__x64_sys_setdomainname': -3 (?)
+test_overhead # attach_fentry unexpected error: -524 (trampoline)
+test_profiler # unknown func bpf_probe_read_str#45 (overlapping)
+timer # failed to auto-attach program 'test1': -524 (trampoline)
+timer_crash # trampoline
+timer_mim # failed to auto-attach program 'test1': -524 (trampoline)
+trace_ext # failed to auto-attach program 'test_pkt_md_access_new': -524 (trampoline)
+trace_printk # trace_printk__load unexpected error: -2 (errno 2) (?)
+trace_vprintk # trace_vprintk__open_and_load unexpected error: -9 (?)
+trampoline_count # prog 'prog1': failed to attach: ERROR: strerror_r(-524)=22 (trampoline)
+verif_stats # trace_vprintk__open_and_load unexpected error: -9 (?)
+vmlinux # failed to auto-attach program 'handle__fentry': -524 (trampoline)
+xdp_adjust_tail # case-128 err 0 errno 28 retval 1 size 128 expect-size 3520 (?)
+xdp_bonding # failed to auto-attach program 'trace_on_entry': -524 (trampoline)
+xdp_bpf2bpf # failed to auto-attach program 'trace_on_entry': -524 (trampoline)
+map_kptr # failed to open_and_load program: -524 (trampoline)
+bpf_cookie # failed to open_and_load program: -524 (trampoline)
+xdp_do_redirect # prog_run_max_size unexpected error: -22 (errno 22)
+send_signal # intermittently fails to receive signal
+select_reuseport # intermittently fails on new s390x setup
+xdp_synproxy # JIT does not support calling kernel function (kfunc)
+unpriv_bpf_disabled # fentry
+lru_bug
diff --git a/lib/libbpf/ci/vmtest/helpers.sh b/lib/libbpf/ci/vmtest/helpers.sh
new file mode 100755
index 0000000..3b2cda0
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/helpers.sh
@@ -0,0 +1,36 @@
+# $1 - start or end
+# $2 - fold identifier, no spaces
+# $3 - fold section description
+foldable() {
+ local YELLOW='\033[1;33m'
+ local NOCOLOR='\033[0m'
+ if [ $1 = "start" ]; then
+ line="::group::$2"
+ if [ ! -z "${3:-}" ]; then
+ line="$line - ${YELLOW}$3${NOCOLOR}"
+ fi
+ else
+ line="::endgroup::"
+ fi
+ echo -e "$line"
+}
+
+__print() {
+ local TITLE=""
+ if [[ -n $2 ]]; then
+ TITLE=" title=$2"
+ fi
+ echo "::$1${TITLE}::$3"
+}
+
+# $1 - title
+# $2 - message
+print_error() {
+ __print error $1 $2
+}
+
+# $1 - title
+# $2 - message
+print_notice() {
+ __print notice $1 $2
+}
diff --git a/lib/libbpf/ci/vmtest/run_selftests.sh b/lib/libbpf/ci/vmtest/run_selftests.sh
new file mode 100755
index 0000000..4ae05ed
--- /dev/null
+++ b/lib/libbpf/ci/vmtest/run_selftests.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+
+set -euo pipefail
+
+source $(cd $(dirname $0) && pwd)/helpers.sh
+
+ARCH=$(uname -m)
+
+STATUS_FILE=/exitstatus
+
+read_lists() {
+ (for path in "$@"; do
+ if [[ -s "$path" ]]; then
+ cat "$path"
+ fi;
+ done) | cut -d'#' -f1 | tr -s ' \t\n' ','
+}
+
+test_progs() {
+ if [[ "${KERNEL}" != '4.9.0' ]]; then
+ foldable start test_progs "Testing test_progs"
+ # "&& true" does not change the return code (it is not executed
+ # if the Python script fails), but it prevents exiting on a
+ # failure due to the "set -e".
+ ./test_progs ${DENYLIST:+-d$DENYLIST} ${ALLOWLIST:+-a$ALLOWLIST} && true
+ echo "test_progs:$?" >> "${STATUS_FILE}"
+ foldable end test_progs
+ fi
+}
+
+test_progs_noalu() {
+ foldable start test_progs-no_alu32 "Testing test_progs-no_alu32"
+ ./test_progs-no_alu32 ${DENYLIST:+-d$DENYLIST} ${ALLOWLIST:+-a$ALLOWLIST} && true
+ echo "test_progs-no_alu32:$?" >> "${STATUS_FILE}"
+ foldable end test_progs-no_alu32
+}
+
+test_maps() {
+ if [[ "${KERNEL}" == 'latest' ]]; then
+ foldable start test_maps "Testing test_maps"
+ ./test_maps && true
+ echo "test_maps:$?" >> "${STATUS_FILE}"
+ foldable end test_maps
+ fi
+}
+
+test_verifier() {
+ if [[ "${KERNEL}" == 'latest' ]]; then
+ foldable start test_verifier "Testing test_verifier"
+ ./test_verifier && true
+ echo "test_verifier:$?" >> "${STATUS_FILE}"
+ foldable end test_verifier
+ fi
+}
+
+foldable end vm_init
+
+configs_path=${PROJECT_NAME}/vmtest/configs
+DENYLIST=$(read_lists "$configs_path/DENYLIST-${KERNEL}" "$configs_path/DENYLIST-${KERNEL}.${ARCH}")
+ALLOWLIST=$(read_lists "$configs_path/ALLOWLIST-${KERNEL}" "$configs_path/ALLOWLIST-${KERNEL}.${ARCH}")
+
+echo "DENYLIST: ${DENYLIST}"
+echo "ALLOWLIST: ${ALLOWLIST}"
+
+cd ${PROJECT_NAME}/selftests/bpf
+
+if [ $# -eq 0 ]; then
+ test_progs
+ test_progs_noalu
+ test_maps
+ test_verifier
+else
+ for test_name in "$@"; do
+ "${test_name}"
+ done
+fi