resolve_btfids: Fix the _impl lookup for module BTF

process_kfunc_with_implicit_args() skips generating <name>_impl
function when one already exists for backwards compatibility.

It uses btf__find_by_name_kind(), which searches the base BTF before
the split BTF. When resolve_btfids processes a module, a same-named
_impl in vmlinux would be found and the module's own counterpart would
not be created.

Fix by using btf__find_by_name_kind_own() for the lookup.

Signed-off-by: Ihor Solodrai <ihor.solodrai@linux.dev>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/bpf/20260722233518.778854-6-ihor.solodrai@linux.dev
This commit is contained in:
Ihor Solodrai
2026-07-22 16:35:15 -07:00
committed by Andrii Nakryiko
parent ef242559eb
commit 91efe50e30

View File

@@ -1232,7 +1232,7 @@ static int process_kfunc_with_implicit_args(struct btf2btf_context *ctx, struct
return -E2BIG;
}
if (btf__find_by_name_kind(btf, tmp_name, BTF_KIND_FUNC) > 0) {
if (btf__find_by_name_kind_own(btf, tmp_name, BTF_KIND_FUNC) > 0) {
pr_debug("resolve_btfids: function %s already exists in BTF\n", tmp_name);
goto add_new_proto;
}