summaryrefslogtreecommitdiff
path: root/tools/testing
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2026-03-09 19:28:43 +0300
committerAlexei Starovoitov <ast@kernel.org>2026-03-09 19:28:43 +0300
commitbd2e02e3c9215305dfa344c050d5822f19929cf7 (patch)
tree4782826af167dab0c11f8dd9f8ffa600dc5328dc /tools/testing
parent099bded7525d9803f62bc5a1ed60e2c9ec4851e0 (diff)
parentfcec7c66d68165b69b3cef6af913a435a25e36a1 (diff)
downloadlinux-bd2e02e3c9215305dfa344c050d5822f19929cf7.tar.xz
Merge branch 'always-allow-sleepable-and-fmod_ret-programs-on-syscalls'
Viktor Malik says: ==================== Always allow sleepable and fmod_ret programs on syscalls Both sleepable and fmod_ret programs are only allowed on selected functions. For convenience, the error injection list was originally used. When error injection is disabled, that list is empty and sleepable tracing programs, as well as fmod_ret programs, are effectively unavailable. This patch series addresses the issue by at least enabling sleepable and fmod_ret programs on syscalls, if error injection is disabled. More details on why syscalls are used can be found in [1]. [1] https://lore.kernel.org/bpf/CAADnVQK6qP8izg+k9yV0vdcT-+=axtFQ2fKw7D-2Ei-V6WS5Dw@mail.gmail.com/ Changes in v3: - Handle LoongArch (Leon) - Add Kumar's and Leon's acks Changes in v2: - Check "sys_" prefix instead of "sys" for powerpc syscalls (AI review) - Add link to the original discussion (Kumar) - Add explanation why arch syscall prefixes are hard-coded (Leon) ==================== Link: https://patch.msgid.link/cover.1773055375.git.vmalik@redhat.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/bpf/progs/refcounted_kptr.c4
-rw-r--r--tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/progs/refcounted_kptr.c b/tools/testing/selftests/bpf/progs/refcounted_kptr.c
index 1aca85d86aeb..c847398837cc 100644
--- a/tools/testing/selftests/bpf/progs/refcounted_kptr.c
+++ b/tools/testing/selftests/bpf/progs/refcounted_kptr.c
@@ -500,7 +500,7 @@ long rbtree_wrong_owner_remove_fail_a2(void *ctx)
return 0;
}
-SEC("?fentry.s/bpf_testmod_test_read")
+SEC("?fentry.s/" SYS_PREFIX "sys_getpgid")
__success
int BPF_PROG(rbtree_sleepable_rcu,
struct file *file, struct kobject *kobj,
@@ -534,7 +534,7 @@ err_out:
return 0;
}
-SEC("?fentry.s/bpf_testmod_test_read")
+SEC("?fentry.s/" SYS_PREFIX "sys_getpgid")
__success
int BPF_PROG(rbtree_sleepable_rcu_no_explicit_rcu_lock,
struct file *file, struct kobject *kobj,
diff --git a/tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c b/tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c
index 836c8ab7b908..b2808bfcec29 100644
--- a/tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c
+++ b/tools/testing/selftests/bpf/progs/refcounted_kptr_fail.c
@@ -93,7 +93,7 @@ long rbtree_refcounted_node_ref_escapes_owning_input(void *ctx)
return 0;
}
-SEC("?fentry.s/bpf_testmod_test_read")
+SEC("?fentry.s/" SYS_PREFIX "sys_getpgid")
__failure __msg("function calls are not allowed while holding a lock")
int BPF_PROG(rbtree_fail_sleepable_lock_across_rcu,
struct file *file, struct kobject *kobj,