]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
selftests/bpf: Enforce returning 0 for fentry/fexit programs
authorYonghong Song <yhs@fb.com>
Thu, 14 May 2020 05:32:07 +0000 (22:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 May 2020 06:22:38 +0000 (08:22 +0200)
commit 6d74f64b922b8394dccc52576659cb0dc0a1da7b upstream.

There are a few fentry/fexit programs returning non-0.
The tests with these programs will break with the previous
patch which enfoced return-0 rules. Fix them properly.

Fixes: ac065870d928 ("selftests/bpf: Add BPF_PROG, BPF_KPROBE, and BPF_KRETPROBE macros")
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/20200514053207.1298479-1-yhs@fb.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/bpf/progs/test_overhead.c

index bfe9fbcb968416685c29aeff79537723651f8e98..e15c7589695ebae9be1f83dc95e1a8df4e65b4ae 100644 (file)
@@ -33,13 +33,13 @@ int prog3(struct bpf_raw_tracepoint_args *ctx)
 SEC("fentry/__set_task_comm")
 int BPF_PROG(prog4, struct task_struct *tsk, const char *buf, bool exec)
 {
-       return !tsk;
+       return 0;
 }
 
 SEC("fexit/__set_task_comm")
 int BPF_PROG(prog5, struct task_struct *tsk, const char *buf, bool exec)
 {
-       return !tsk;
+       return 0;
 }
 
 char _license[] SEC("license") = "GPL";