1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2022 Meta Platforms, Inc. and affiliates. */
4 #include <bpf/bpf_tracing.h>
5 #include <bpf/bpf_helpers.h>
6 #include "../bpf_testmod/bpf_testmod_kfunc.h"
8 static struct prog_test_ref_kfunc __kptr *v;
12 int test_jit_probe_mem(struct __sk_buff *ctx)
14 struct prog_test_ref_kfunc *p;
15 unsigned long zero = 0, sum;
17 p = bpf_kfunc_call_test_acquire(&zero);
21 p = bpf_kptr_xchg(&v, p);
25 /* Direct map value access of kptr, should be PTR_UNTRUSTED */
35 "r8 = *(u32 *)(r9 + 0);"
39 "r8 = *(u32 *)(r9 + 4);"
44 "r9 = *(u32 *)(r9 - 8);"
55 bpf_kfunc_call_test_release(p);
59 char _license[] SEC("license") = "GPL";