Skip to content

allow calling kfuncs in normal tracepoint programs

JP Kobryn bpf 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2bpf/selftests: coverage for calling kfuncs within tracepointtools/testing/selftests/bpf/prog_tests/kfunc_in_tp.c tools/testing/selftests/bpf/progs/test_kfunc_in_tp.c+69 -01 reply
2/2bpf: allow kfuncs within normal tracepoint programskernel/bpf/btf.c+1 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/2] allow calling kfuncs in normal tracepoint programs

It is possible to call a kfunc within a raw tp_btf program but not possible within a normal tracepoint program. Currently, it seems the verifier receives -EACCESS from fetch_kfunc_meta() as a result of not finding any hook within btf_kfunc_id_set_contains().

The first patch exposes the issue (as a selftest) while the second patch updates the kfunc hook lookup to account for tracepoint programs.

Pre-submission CI run: https://github.com/kernel-patches/bpf/pull/7539

JP Kobryn (2):
bpf/selftests: coverage for calling kfuncs within tracepoint
bpf: allow kfuncs within normal tracepoint programs

 kernel/bpf/btf.c                              |  1 +
 .../selftests/bpf/prog_tests/kfunc_in_tp.c    | 34 ++++++++++++++++++
 .../selftests/bpf/progs/test_kfunc_in_tp.c    | 35 +++++++++++++++++++
 3 files changed, 70 insertions(+)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/kfunc_in_tp.c
 create mode 100644 tools/testing/selftests/bpf/progs/test_kfunc_in_tp.c
Signature · 1 line
2.46.0