Skip to contentSkip to conversation

bpf, btf: switch CONFIG_CFI_CLANG to CONFIG_CFI

PATCH Applied Carlos Llamas 4 participants 4 messages Mar 12 – Mar 24 BPF

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bpf, btf: switch CONFIG_CFI_CLANG to CONFIG_CFI

This was renamed in commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") as it is now a compiler-agnostic option. Using the wrong name results in the code getting compiled out. Meaning the CFI failures for btf_dtor_kfunc_t would still trigger.

Fixes 99fde4d06261 ("bpf, btf: Enforce destructor kfunc type with CFI")
---
 kernel/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +1 -1
index 4872d2a6c42d..84665f76a3c6 100644
@@ -9003,7 +9003,7 @@ static int btf_check_dtor_kfuncs(struct btf *btf, const struct btf_id_dtor_kfunc
 		if (!t || !btf_type_is_ptr(t))
 			return -EINVAL;
 
-		if (IS_ENABLED(CONFIG_CFI_CLANG)) {
+		if (IS_ENABLED(CONFIG_CFI)) {
 			/* Ensure the destructor kfunc type matches btf_dtor_kfunc_t */
 			t = btf_type_by_id(btf, t->type);
 			if (!btf_type_is_void(t))
Signature · 1 line
2.53.0.880.g73c4285caa-goog
Reviewed-by on v1 1/1
#1 lore raw

Hi Carlos,

Quoted 17 lines · Carlos Llamas

This was renamed in commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") as it is now a compiler-agnostic option. Using the wrong name results in the code getting compiled out. Meaning the CFI failures for btf_dtor_kfunc_t would still trigger.

Fixes 99fde4d06261 ("bpf, btf: Enforce destructor kfunc type with CFI")
---
 kernel/bpf/btf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/bpf/btf.c +0 -0
index 4872d2a6c42d..84665f76a3c6 100644

kernel/bpf/btf.c static int btf_check_dtor_kfuncs(struct btf *btf, const struct btf_id_dtor_kfunc · line 9009

Quoted 8 lines
kernel/bpf/btf.c +1 -1
@@ -9003,7 +9003,7 @@ static int btf_check_dtor_kfuncs(struct btf *btf, const struct btf_id_dtor_kfunc
                if (!t || !btf_type_is_ptr(t))
                        return -EINVAL;
 
-               if (IS_ENABLED(CONFIG_CFI_CLANG)) {
+               if (IS_ENABLED(CONFIG_CFI)) {
                        /* Ensure the destructor kfunc type matches btf_dtor_kfunc_t */
                        t = btf_type_by_id(btf, t->type);
                        if (!btf_type_is_void(t))

Thanks for the fix!

Sami

reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Carlos Llamas
Quoted 7 lines · Carlos Llamas

This was renamed in commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") as it is now a compiler-agnostic option. Using the wrong name results in the code getting compiled out. Meaning the CFI failures for btf_dtor_kfunc_t would still trigger.

Fixes 99fde4d06261 ("bpf, btf: Enforce destructor kfunc type with CFI")
#3 lore raw
In reply to Carlos Llamas
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 9 lines · On Thu, 12 Mar 2026 18:38:17 +0000 you wrote:

This was renamed in commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") as it is now a compiler-agnostic option. Using the wrong name results in the code getting compiled out. Meaning the CFI failures for btf_dtor_kfunc_t would still trigger.

Fixes 99fde4d06261 ("bpf, btf: Enforce destructor kfunc type with CFI")

[...]

Here is the summary with links:
- bpf, btf: switch CONFIG_CFI_CLANG to CONFIG_CFI

    https://git.kernel.org/bpf/bpf-next/c/9b0cf064ea0a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html