Commit 579345e7 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

selftests/bpf: Rename reference_tracking BPF programs

BPF programs for reference_tracking selftest use "fail_" prefix to notify that
they are expected to fail. This is really confusing and inconvenient when
trying to grep through test_progs output to find *actually* failed tests. So
rename the prefix from "fail_" to "err_".
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20210805230734.437914-1-andrii@kernel.org
parent 277b1340
...@@ -34,8 +34,8 @@ void test_reference_tracking(void) ...@@ -34,8 +34,8 @@ void test_reference_tracking(void)
if (!test__start_subtest(title)) if (!test__start_subtest(title))
continue; continue;
/* Expect verifier failure if test name has 'fail' */ /* Expect verifier failure if test name has 'err' */
if (strstr(title, "fail") != NULL) { if (strstr(title, "err_") != NULL) {
libbpf_print_fn_t old_print_fn; libbpf_print_fn_t old_print_fn;
old_print_fn = libbpf_set_print(NULL); old_print_fn = libbpf_set_print(NULL);
......
...@@ -91,7 +91,7 @@ int bpf_sk_lookup_test1(struct __sk_buff *skb) ...@@ -91,7 +91,7 @@ int bpf_sk_lookup_test1(struct __sk_buff *skb)
return 0; return 0;
} }
SEC("classifier/fail_use_after_free") SEC("classifier/err_use_after_free")
int bpf_sk_lookup_uaf(struct __sk_buff *skb) int bpf_sk_lookup_uaf(struct __sk_buff *skb)
{ {
struct bpf_sock_tuple tuple = {}; struct bpf_sock_tuple tuple = {};
...@@ -106,7 +106,7 @@ int bpf_sk_lookup_uaf(struct __sk_buff *skb) ...@@ -106,7 +106,7 @@ int bpf_sk_lookup_uaf(struct __sk_buff *skb)
return family; return family;
} }
SEC("classifier/fail_modify_sk_pointer") SEC("classifier/err_modify_sk_pointer")
int bpf_sk_lookup_modptr(struct __sk_buff *skb) int bpf_sk_lookup_modptr(struct __sk_buff *skb)
{ {
struct bpf_sock_tuple tuple = {}; struct bpf_sock_tuple tuple = {};
...@@ -121,7 +121,7 @@ int bpf_sk_lookup_modptr(struct __sk_buff *skb) ...@@ -121,7 +121,7 @@ int bpf_sk_lookup_modptr(struct __sk_buff *skb)
return 0; return 0;
} }
SEC("classifier/fail_modify_sk_or_null_pointer") SEC("classifier/err_modify_sk_or_null_pointer")
int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb) int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb)
{ {
struct bpf_sock_tuple tuple = {}; struct bpf_sock_tuple tuple = {};
...@@ -135,7 +135,7 @@ int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb) ...@@ -135,7 +135,7 @@ int bpf_sk_lookup_modptr_or_null(struct __sk_buff *skb)
return 0; return 0;
} }
SEC("classifier/fail_no_release") SEC("classifier/err_no_release")
int bpf_sk_lookup_test2(struct __sk_buff *skb) int bpf_sk_lookup_test2(struct __sk_buff *skb)
{ {
struct bpf_sock_tuple tuple = {}; struct bpf_sock_tuple tuple = {};
...@@ -144,7 +144,7 @@ int bpf_sk_lookup_test2(struct __sk_buff *skb) ...@@ -144,7 +144,7 @@ int bpf_sk_lookup_test2(struct __sk_buff *skb)
return 0; return 0;
} }
SEC("classifier/fail_release_twice") SEC("classifier/err_release_twice")
int bpf_sk_lookup_test3(struct __sk_buff *skb) int bpf_sk_lookup_test3(struct __sk_buff *skb)
{ {
struct bpf_sock_tuple tuple = {}; struct bpf_sock_tuple tuple = {};
...@@ -156,7 +156,7 @@ int bpf_sk_lookup_test3(struct __sk_buff *skb) ...@@ -156,7 +156,7 @@ int bpf_sk_lookup_test3(struct __sk_buff *skb)
return 0; return 0;
} }
SEC("classifier/fail_release_unchecked") SEC("classifier/err_release_unchecked")
int bpf_sk_lookup_test4(struct __sk_buff *skb) int bpf_sk_lookup_test4(struct __sk_buff *skb)
{ {
struct bpf_sock_tuple tuple = {}; struct bpf_sock_tuple tuple = {};
...@@ -173,7 +173,7 @@ void lookup_no_release(struct __sk_buff *skb) ...@@ -173,7 +173,7 @@ void lookup_no_release(struct __sk_buff *skb)
bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0); bpf_sk_lookup_tcp(skb, &tuple, sizeof(tuple), BPF_F_CURRENT_NETNS, 0);
} }
SEC("classifier/fail_no_release_subcall") SEC("classifier/err_no_release_subcall")
int bpf_sk_lookup_test5(struct __sk_buff *skb) int bpf_sk_lookup_test5(struct __sk_buff *skb)
{ {
lookup_no_release(skb); lookup_no_release(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment