Re: [PATCH bpf-next v4 0/4] Use correct destructor kfunc types

From: Viktor Malik

Date: Fri Jan 09 2026 - 03:53:36 EST


On 1/5/26 17:16, Alexei Starovoitov wrote:
> On Mon, Jan 5, 2026 at 5:56 AM Viktor Malik <vmalik@xxxxxxxxxx> wrote:
>>
>> On 11/26/25 23:17, Sami Tolvanen wrote:
>>> Hi folks,
>>>
>>> While running BPF self-tests with CONFIG_CFI (Control Flow
>>> Integrity) enabled, I ran into a couple of failures in
>>> bpf_obj_free_fields() caused by type mismatches between the
>>> btf_dtor_kfunc_t function pointer type and the registered
>>> destructor functions.
>>>
>>> It looks like we can't change the argument type for these
>>> functions to match btf_dtor_kfunc_t because the verifier doesn't
>>> like void pointer arguments for functions used in BPF programs,
>>> so this series fixes the issue by adding stubs with correct types
>>> to use as destructors for each instance of this I found in the
>>> kernel tree.
>>>
>>> The last patch changes btf_check_dtor_kfuncs() to enforce the
>>> function type when CFI is enabled, so we don't end up registering
>>> destructors that panic the kernel.
>>
>> Hi,
>>
>> this seems to have slipped through the cracks so I'm bumping the thread.
>> It would be nice if we could merge this.
>
> It did. Please rebase, resend.

@Sami, could you please rebase and resend?

Thanks!

>