History

bpf: selftests: Add selftests for module kfunc support

This adds selftests that tests the success and failure path for modules kfuncs (in presence of invalid kfunc calls) for both libbpf and gen_loader. It also adds a prog_test kfunc_btf_id_list so that we can add module BTF ID set from bpf_testmod. This also introduces a couple of test cases to verifier selftests for validating whether we get an error or not depending on if invalid kfunc call remains after elimination of unreachable instructions.

Kumar Kartikeya Dwivedi committed 5 years ago

Commit c48e51c1 parent 18f4fcc9 files · +132 −31Browse files

Showing the changes to kernel (1 of 9 files). Show all

Unified · Split

kernel/bpf/btf.c+1−0
@@ -6397,3 +6397,4 @@ bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, · 6396 unmodified lines
63976397 EXPORT_SYMBOL_GPL(name)
63986398
63996399 DEFINE_KFUNC_BTF_ID_LIST(bpf_tcp_ca_kfunc_list);
6400+DEFINE_KFUNC_BTF_ID_LIST(prog_test_kfunc_list);