Re: [PATCH bpf-next v3 1/4] bpf: crypto: Use the correct destructor kfunc type
From: Sami Tolvanen
Date: Tue Nov 25 2025 - 15:19:52 EST
Hi Viktor,
On Fri, Nov 21, 2025 at 8:06 AM Viktor Malik <vmalik@xxxxxxxxxx> wrote:
>
> On 7/28/25 22:26, Sami Tolvanen wrote:
> > With CONFIG_CFI_CLANG enabled, the kernel strictly enforces that
> > indirect function calls use a function pointer type that matches the
> > target function. I ran into the following type mismatch when running
> > BPF self-tests:
> >
> > CFI failure at bpf_obj_free_fields+0x190/0x238 (target:
> > bpf_crypto_ctx_release+0x0/0x94; expected type: 0xa488ebfc)
> > Internal error: Oops - CFI: 00000000f2008228 [#1] SMP
> > ...
> >
> > As bpf_crypto_ctx_release() is also used in BPF programs and using
> > a void pointer as the argument would make the verifier unhappy, add
> > a simple stub function with the correct type and register it as the
> > destructor kfunc instead.
>
> Hi,
>
> this patchset got somehow forgotten and I'd like to revive it.
>
> We're hitting kernel oops when running the crypto cases from test_progs
> (`./test_progs -t crypto`) on CPUs with IBT (Indirect Branch Tracking)
> support. I managed to reproduce this on the latest bpf-next, see the
> relevant part of dmesg at the end of this email.
>
> After applying this patch, the oops no longer happens.
>
> It looks like the series is stuck on a sparse warning reported by kernel
> test robot, which seems like a false positive. Could we somehow resolve
> it and proceed with reviewing and merging this?
I agree, it does look like a false positive.
> Since this resolves our issue, adding my tested-by:
>
> Tested-by: Viktor Malik <vmalik@xxxxxxxxxx>
Thanks for testing! I can resend this series when I have a chance to
put it back in the review queue. The CFI config option also changed
from CONFIG_CFI_CLANG to just CONFIG_CFI since this was sent, so the
commit message could use an update too.
Sami