summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/prog_tests/clone_module_kfunc.c
AgeCommit message (Collapse)Author
6 daysselftests/bpf: Clone a program that calls a module kfuncKumar Kartikeya Dwivedi
Prepare an object whose program calls a kfunc of bpf_testmod and load the program through bpf_program__clone(), the way veristat loads programs. The module BTF fd sits in slot 1 of the fd_array of the object and slot 0 is empty; the clone used to pass the fill index of that array as fd_array_cnt, which made the kernel resolve slot 0 and fail the load with "fd 0 is not pointing to valid bpf_map or btf". Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://patch.msgid.link/20261019132203.3034698-5-memxor@gmail.com