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.
Showing the changes to kernel (1 of 9 files). Show all
Unified · Split
| @@ -6397,3 +6397,4 @@ bool bpf_check_mod_kfunc_call(struct kfunc_btf_id_list *klist, u32 kfunc_id, · 6396 unmodified lines | |||
| 6397 | EXPORT_SYMBOL_GPL(name) | 6397 | EXPORT_SYMBOL_GPL(name) |
| 6398 | 6398 | ||
| 6399 | DEFINE_KFUNC_BTF_ID_LIST(bpf_tcp_ca_kfunc_list); | 6399 | DEFINE_KFUNC_BTF_ID_LIST(bpf_tcp_ca_kfunc_list); |
| 6400 | DEFINE_KFUNC_BTF_ID_LIST(prog_test_kfunc_list); | ||