On Fri, 2024-02-16 at 22:52 +0100, Kumar Kartikeya Dwivedi wrote: [...] > I think these btf pointers are just a view, the real owner is in > the used_btfs array, in case of failure, it is dropped as part of > bpf_verifier_env cleanup, or in case of success, transferred to > bpf_prog struct and released on bpf_prog cleanup. > So I think it should be ok, but I will recheck again. You are correct and I'm wrong, add_used_btf() indeed pushes link to env->used_btfs, sorry for the noise.