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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
2.46.0





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux