@@ -540,17 +540,17 @@ struct bpf_fentry_test_t {
struct bpf_fentry_test_t *a;
};
-int noinline bpf_fentry_test7(struct bpf_fentry_test_t *arg)
+noinline int bpf_fentry_test_ptr1(struct bpf_fentry_test_t *arg)
{
return (long)arg;
}
-int noinline bpf_fentry_test8(struct bpf_fentry_test_t *arg)
+noinline int bpf_fentry_test_ptr2(struct bpf_fentry_test_t *arg)
{
return (long)arg->a;
}
-__bpf_kfunc u32 bpf_fentry_test9(u32 *a)
+__bpf_kfunc u32 bpf_fentry_test_ptr3(u32 *a)
{
return *a;
}
@@ -655,9 +655,9 @@ int bpf_prog_test_run_tracing(struct bpf_prog *prog,
bpf_fentry_test4((void *)7, 8, 9, 10) != 34 ||
bpf_fentry_test5(11, (void *)12, 13, 14, 15) != 65 ||
bpf_fentry_test6(16, (void *)17, 18, 19, (void *)20, 21) != 111 ||
- bpf_fentry_test7((struct bpf_fentry_test_t *)0) != 0 ||
- bpf_fentry_test8(&arg) != 0 ||
- bpf_fentry_test9(&retval) != 0)
+ bpf_fentry_test_ptr1((struct bpf_fentry_test_t *)0) != 0 ||
+ bpf_fentry_test_ptr2(&arg) != 0 ||
+ bpf_fentry_test_ptr3(&retval) != 0)
goto out;
break;
case BPF_MODIFY_RETURN:
@@ -125,9 +125,9 @@ static void kprobe_multi_link_api_subtest(void)
GET_ADDR("bpf_fentry_test4", addrs[2]);
GET_ADDR("bpf_fentry_test5", addrs[3]);
GET_ADDR("bpf_fentry_test6", addrs[4]);
- GET_ADDR("bpf_fentry_test7", addrs[5]);
+ GET_ADDR("bpf_fentry_test_ptr1", addrs[5]);
GET_ADDR("bpf_fentry_test2", addrs[6]);
- GET_ADDR("bpf_fentry_test8", addrs[7]);
+ GET_ADDR("bpf_fentry_test_ptr2", addrs[7]);
#undef GET_ADDR
@@ -136,9 +136,9 @@ static void kprobe_multi_link_api_subtest(void)
cookies[2] = 3; /* bpf_fentry_test4 */
cookies[3] = 4; /* bpf_fentry_test5 */
cookies[4] = 5; /* bpf_fentry_test6 */
- cookies[5] = 6; /* bpf_fentry_test7 */
+ cookies[5] = 6; /* bpf_fentry_test_ptr1 */
cookies[6] = 7; /* bpf_fentry_test2 */
- cookies[7] = 8; /* bpf_fentry_test8 */
+ cookies[7] = 8; /* bpf_fentry_test_ptr2 */
opts.kprobe_multi.addrs = (const unsigned long *) &addrs;
opts.kprobe_multi.cnt = ARRAY_SIZE(addrs);
@@ -154,9 +154,9 @@ static void kprobe_multi_link_api_subtest(void)
cookies[2] = 6; /* bpf_fentry_test4 */
cookies[3] = 5; /* bpf_fentry_test5 */
cookies[4] = 4; /* bpf_fentry_test6 */
- cookies[5] = 3; /* bpf_fentry_test7 */
+ cookies[5] = 3; /* bpf_fentry_test_ptr1 */
cookies[6] = 2; /* bpf_fentry_test2 */
- cookies[7] = 1; /* bpf_fentry_test8 */
+ cookies[7] = 1; /* bpf_fentry_test_ptr2 */
opts.kprobe_multi.flags = BPF_F_KPROBE_MULTI_RETURN;
prog_fd = bpf_program__fd(skel->progs.test_kretprobe);
@@ -185,9 +185,9 @@ static void kprobe_multi_attach_api_subtest(void)
"bpf_fentry_test4",
"bpf_fentry_test5",
"bpf_fentry_test6",
- "bpf_fentry_test7",
+ "bpf_fentry_test_ptr1",
"bpf_fentry_test2",
- "bpf_fentry_test8",
+ "bpf_fentry_test_ptr2",
};
__u64 cookies[8];
@@ -203,9 +203,9 @@ static void kprobe_multi_attach_api_subtest(void)
cookies[2] = 3; /* bpf_fentry_test4 */
cookies[3] = 4; /* bpf_fentry_test5 */
cookies[4] = 5; /* bpf_fentry_test6 */
- cookies[5] = 6; /* bpf_fentry_test7 */
+ cookies[5] = 6; /* bpf_fentry_test_ptr1 */
cookies[6] = 7; /* bpf_fentry_test2 */
- cookies[7] = 8; /* bpf_fentry_test8 */
+ cookies[7] = 8; /* bpf_fentry_test_ptr2 */
opts.syms = syms;
opts.cnt = ARRAY_SIZE(syms);
@@ -221,9 +221,9 @@ static void kprobe_multi_attach_api_subtest(void)
cookies[2] = 6; /* bpf_fentry_test4 */
cookies[3] = 5; /* bpf_fentry_test5 */
cookies[4] = 4; /* bpf_fentry_test6 */
- cookies[5] = 3; /* bpf_fentry_test7 */
+ cookies[5] = 3; /* bpf_fentry_test_ptr1 */
cookies[6] = 2; /* bpf_fentry_test2 */
- cookies[7] = 1; /* bpf_fentry_test8 */
+ cookies[7] = 1; /* bpf_fentry_test_ptr2 */
opts.retprobe = true;
@@ -105,8 +105,8 @@ static void test_link_api_addrs(void)
GET_ADDR("bpf_fentry_test4", addrs[3]);
GET_ADDR("bpf_fentry_test5", addrs[4]);
GET_ADDR("bpf_fentry_test6", addrs[5]);
- GET_ADDR("bpf_fentry_test7", addrs[6]);
- GET_ADDR("bpf_fentry_test8", addrs[7]);
+ GET_ADDR("bpf_fentry_test_ptr1", addrs[6]);
+ GET_ADDR("bpf_fentry_test_ptr2", addrs[7]);
opts.kprobe_multi.addrs = (const unsigned long*) addrs;
opts.kprobe_multi.cnt = ARRAY_SIZE(addrs);
@@ -123,8 +123,8 @@ static void test_link_api_syms(void)
"bpf_fentry_test4",
"bpf_fentry_test5",
"bpf_fentry_test6",
- "bpf_fentry_test7",
- "bpf_fentry_test8",
+ "bpf_fentry_test_ptr1",
+ "bpf_fentry_test_ptr2",
};
opts.kprobe_multi.syms = syms;
@@ -183,8 +183,8 @@ static void test_attach_api_addrs(void)
GET_ADDR("bpf_fentry_test4", addrs[3]);
GET_ADDR("bpf_fentry_test5", addrs[4]);
GET_ADDR("bpf_fentry_test6", addrs[5]);
- GET_ADDR("bpf_fentry_test7", addrs[6]);
- GET_ADDR("bpf_fentry_test8", addrs[7]);
+ GET_ADDR("bpf_fentry_test_ptr1", addrs[6]);
+ GET_ADDR("bpf_fentry_test_ptr2", addrs[7]);
opts.addrs = (const unsigned long *) addrs;
opts.cnt = ARRAY_SIZE(addrs);
@@ -201,8 +201,8 @@ static void test_attach_api_syms(void)
"bpf_fentry_test4",
"bpf_fentry_test5",
"bpf_fentry_test6",
- "bpf_fentry_test7",
- "bpf_fentry_test8",
+ "bpf_fentry_test_ptr1",
+ "bpf_fentry_test_ptr2",
};
opts.syms = syms;
@@ -60,20 +60,20 @@ struct bpf_fentry_test_t {
struct bpf_fentry_test_t *a;
};
-__u64 test7_result = 0;
-SEC("fentry/bpf_fentry_test7")
-int BPF_PROG(test7, struct bpf_fentry_test_t *arg)
+__u64 test_ptr1_result = 0;
+SEC("fentry/bpf_fentry_test_ptr1")
+int BPF_PROG(test_ptr1, struct bpf_fentry_test_t *arg)
{
if (!arg)
- test7_result = 1;
+ test_ptr1_result = 1;
return 0;
}
-__u64 test8_result = 0;
-SEC("fentry/bpf_fentry_test8")
-int BPF_PROG(test8, struct bpf_fentry_test_t *arg)
+__u64 test_ptr2_result = 0;
+SEC("fentry/bpf_fentry_test_ptr2")
+int BPF_PROG(test_ptr2, struct bpf_fentry_test_t *arg)
{
if (arg->a == 0)
- test8_result = 1;
+ test_ptr2_result = 1;
return 0;
}
@@ -61,20 +61,20 @@ struct bpf_fentry_test_t {
struct bpf_fentry_test *a;
};
-__u64 test7_result = 0;
-SEC("fexit/bpf_fentry_test7")
-int BPF_PROG(test7, struct bpf_fentry_test_t *arg)
+__u64 test_ptr1_result = 0;
+SEC("fexit/bpf_fentry_test_ptr1")
+int BPF_PROG(test_ptr1, struct bpf_fentry_test_t *arg)
{
if (!arg)
- test7_result = 1;
+ test_ptr1_result = 1;
return 0;
}
-__u64 test8_result = 0;
-SEC("fexit/bpf_fentry_test8")
-int BPF_PROG(test8, struct bpf_fentry_test_t *arg)
+__u64 test_ptr2_result = 0;
+SEC("fexit/bpf_fentry_test_ptr2")
+int BPF_PROG(test_ptr2, struct bpf_fentry_test_t *arg)
{
if (!arg->a)
- test8_result = 1;
+ test_ptr2_result = 1;
return 0;
}
@@ -12,7 +12,7 @@ extern const void bpf_fentry_test3 __ksym;
extern const void bpf_fentry_test4 __ksym;
extern const void bpf_modify_return_test __ksym;
extern const void bpf_fentry_test6 __ksym;
-extern const void bpf_fentry_test7 __ksym;
+extern const void bpf_fentry_test_ptr1 __ksym;
extern bool CONFIG_X86_KERNEL_IBT __kconfig __weak;
@@ -12,8 +12,8 @@ extern const void bpf_fentry_test3 __ksym;
extern const void bpf_fentry_test4 __ksym;
extern const void bpf_fentry_test5 __ksym;
extern const void bpf_fentry_test6 __ksym;
-extern const void bpf_fentry_test7 __ksym;
-extern const void bpf_fentry_test8 __ksym;
+extern const void bpf_fentry_test_ptr1 __ksym;
+extern const void bpf_fentry_test_ptr2 __ksym;
int pid = 0;
bool test_cookie = false;
@@ -57,8 +57,8 @@ static void kprobe_multi_check(void *ctx, bool is_return)
SET(kretprobe_test4_result, &bpf_fentry_test4, 6);
SET(kretprobe_test5_result, &bpf_fentry_test5, 5);
SET(kretprobe_test6_result, &bpf_fentry_test6, 4);
- SET(kretprobe_test7_result, &bpf_fentry_test7, 3);
- SET(kretprobe_test8_result, &bpf_fentry_test8, 1);
+ SET(kretprobe_test7_result, &bpf_fentry_test_ptr1, 3);
+ SET(kretprobe_test8_result, &bpf_fentry_test_ptr2, 1);
} else {
SET(kprobe_test1_result, &bpf_fentry_test1, 1);
SET(kprobe_test2_result, &bpf_fentry_test2, 7);
@@ -66,8 +66,8 @@ static void kprobe_multi_check(void *ctx, bool is_return)
SET(kprobe_test4_result, &bpf_fentry_test4, 3);
SET(kprobe_test5_result, &bpf_fentry_test5, 4);
SET(kprobe_test6_result, &bpf_fentry_test6, 5);
- SET(kprobe_test7_result, &bpf_fentry_test7, 6);
- SET(kprobe_test8_result, &bpf_fentry_test8, 8);
+ SET(kprobe_test7_result, &bpf_fentry_test_ptr1, 6);
+ SET(kprobe_test8_result, &bpf_fentry_test_ptr2, 8);
}
#undef SET
@@ -17,7 +17,7 @@ __naked void btf_ctx_access_accept(void)
" ::: __clobber_all);
}
-SEC("fentry/bpf_fentry_test9")
+SEC("fentry/bpf_fentry_test_ptr3")
__description("btf_ctx_access u32 pointer accept")
__success __retval(0)
__naked void ctx_access_u32_pointer_accept(void)
@@ -88,7 +88,7 @@
* kernel function being called. Load first arg into R2.
*/
BPF_LDX_MEM(BPF_DW, BPF_REG_2, BPF_REG_1, 0),
- /* First arg of bpf_fentry_test7 is a pointer to a struct.
+ /* First arg of bpf_fentry_test_ptr1 is a pointer to a struct.
* Attempt to modify that struct. Verifier shouldn't let us
* because it's kernel memory.
*/
@@ -100,7 +100,7 @@
},
.prog_type = BPF_PROG_TYPE_TRACING,
.expected_attach_type = BPF_TRACE_FENTRY,
- .kfunc = "bpf_fentry_test7",
+ .kfunc = "bpf_fentry_test_ptr1",
.result = REJECT,
.errstr = "only read is supported",
},