From: Alexei Starovoitov Date: Tue, 13 Jan 2026 02:53:57 +0000 (-0800) Subject: Merge branch 'use-correct-destructor-kfunc-types' X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c1a3525fd64839d71e0c1a21170003a4621e6e8;p=thirdparty%2Flinux.git Merge branch 'use-correct-destructor-kfunc-types' Sami Tolvanen says: ==================== 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. v5: - Rebased on bpf-next/master again. v4: https://lore.kernel.org/bpf/20251126221724.897221-6-samitolvanen@google.com/ - Rebased on bpf-next/master. - Renamed CONFIG_CFI_CLANG to CONFIG_CFI. - Picked up Acked/Tested-by tags. v3: https://lore.kernel.org/bpf/20250728202656.559071-6-samitolvanen@google.com/ - Renamed the functions and went back to __bpf_kfunc based on review feedback. v2: https://lore.kernel.org/bpf/20250725214401.1475224-6-samitolvanen@google.com/ - Annotated the stubs with CFI_NOSEAL to fix issues with IBT sealing on x86. - Changed __bpf_kfunc to explicit __used __retain. v1: https://lore.kernel.org/bpf/20250724223225.1481960-6-samitolvanen@google.com/ ==================== Acked-by: Martin KaFai Lau Link: https://patch.msgid.link/20260110082548.113748-6-samitolvanen@google.com Signed-off-by: Alexei Starovoitov --- 9c1a3525fd64839d71e0c1a21170003a4621e6e8