Skip to contentSkip to conversation

tools headers: kcfi: rename missed CONFIG_CFI_CLANG

PATCH Superseded Carlos Llamas 3 participants 5 messages Oct 6, 2025 – Oct 7, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools headers: kcfi: rename missed CONFIG_CFI_CLANG

Commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") missed one instance of CONFIG_CFI_CLANG. Rename it to match the original kernel header. This addresses the following build warning:

Warning: Kernel ABI header differences:
diff -u tools/include/linux/cfi_types.h include/linux/cfi_types.h

Cc Kees Cook <[email protected]>
Fixes 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI")
---
 tools/include/linux/cfi_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/linux/cfi_types.h +1 -1
index fb8d90bff92e..a86af9bc8bdc 100644
@@ -43,7 +43,7 @@
 
 #else /* __ASSEMBLY__ */
 
-#ifdef CONFIG_CFI_CLANG
+#ifdef CONFIG_CFI
 #define DEFINE_CFI_TYPE(name, func)						\
 	/*									\
 	 * Force a reference to the function so the compiler generates		\
Signature · 1 line
2.51.0.618.g983fd99d29-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 2 lines · Carlos Llamas

Commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") missed one instance of CONFIG_CFI_CLANG. Rename it to match the original

Technically, this was correct when 23ef9d439769 committed:

  $ git show 23ef9d439769:tools/include/linux/cfi_types.h | grep CONFIG_CFI
  #ifdef CONFIG_CFI
  #else /* CONFIG_CFI */
  #endif /* CONFIG_CFI */

This is a cross tree collision, as

aa34642f6fc3 ("tools headers: Sync linux/cfi_types.h with the kernel source")

was merged in 6.17-rc4 via the perf tools tree but Kees's tree was based on -rc2, so he did not have it. It only becomes a problem on the merge.

Quoted 7 lines

kernel header. This addresses the following build warning:

Warning: Kernel ABI header differences:
diff -u tools/include/linux/cfi_types.h include/linux/cfi_types.h

Cc Kees Cook <[email protected]>
Fixes 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI")

With all that said, I think this fixes tag should really be:

Fixes a5ba183bdeee ("Merge tag 'hardening-v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux")
Quoted 1 line

Regardless, I think the fix is obviously correct.

Quoted 20 lines
---
 tools/include/linux/cfi_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/linux/cfi_types.h +1 -1
index fb8d90bff92e..a86af9bc8bdc 100644
@@ -43,7 +43,7 @@
 
 #else /* __ASSEMBLY__ */
 
-#ifdef CONFIG_CFI_CLANG
+#ifdef CONFIG_CFI
 #define DEFINE_CFI_TYPE(name, func)						\
 	/*									\
 	 * Force a reference to the function so the compiler generates		\
Signature · 1 line
2.51.0.618.g983fd99d29-goog
#2 lore raw
Quoted 11 lines · Nathan Chancellor
Quoted 2 lines · Carlos Llamas

Commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") missed one instance of CONFIG_CFI_CLANG. Rename it to match the original

Technically, this was correct when 23ef9d439769 committed:

  $ git show 23ef9d439769:tools/include/linux/cfi_types.h | grep CONFIG_CFI
  #ifdef CONFIG_CFI
  #else /* CONFIG_CFI */
  #endif /* CONFIG_CFI */
Quoted 7 lines

This is a cross tree collision, as

aa34642f6fc3 ("tools headers: Sync linux/cfi_types.h with the kernel source")

was merged in 6.17-rc4 via the perf tools tree but Kees's tree was based on -rc2, so he did not have it. It only becomes a problem on the merge.

Ha! Excellent detective skills. I totally missed this.

Quoted 11 lines
Quoted 7 lines

kernel header. This addresses the following build warning:

Warning: Kernel ABI header differences:
diff -u tools/include/linux/cfi_types.h include/linux/cfi_types.h

Cc Kees Cook <[email protected]>
Fixes 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI")

With all that said, I think this fixes tag should really be:

Fixes a5ba183bdeee ("Merge tag 'hardening-v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux")

I'll swap the fixes tag for v2 as suggested, thanks!

Quoted 27 lines
Quoted 2 lines

Regardless, I think the fix is obviously correct.

Quoted 20 lines
---
 tools/include/linux/cfi_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/linux/cfi_types.h +1 -1
index fb8d90bff92e..a86af9bc8bdc 100644
@@ -43,7 +43,7 @@
 
 #else /* __ASSEMBLY__ */
 
-#ifdef CONFIG_CFI_CLANG
+#ifdef CONFIG_CFI
 #define DEFINE_CFI_TYPE(name, func)						\
 	/*									\
 	 * Force a reference to the function so the compiler generates		\
Signature · 1 line
2.51.0.618.g983fd99d29-goog
#3 lore raw

PATCH v2 1/1 tools headers: kcfi: rename missed CONFIG_CFI_CLANG

In reply to Nathan Chancellor

Commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") missed one instance of CONFIG_CFI_CLANG. Rename it to match the original kernel header. This addresses the following build warning:

Warning: Kernel ABI header differences:
diff -u tools/include/linux/cfi_types.h include/linux/cfi_types.h

Cc Kees Cook <[email protected]>
Fixes a5ba183bdeee ("Merge tag 'hardening-v6.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux")

---
v2:
- Tag the correct fixes commit per Nathan.
- Collect reviewed tags.

v1:
https://lore.kernel.org/all/[email protected]/

 tools/include/linux/cfi_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/linux/cfi_types.h +1 -1
index fb8d90bff92e..a86af9bc8bdc 100644
@@ -43,7 +43,7 @@
 
 #else /* __ASSEMBLY__ */
 
-#ifdef CONFIG_CFI_CLANG
+#ifdef CONFIG_CFI
 #define DEFINE_CFI_TYPE(name, func)						\
 	/*									\
 	 * Force a reference to the function so the compiler generates		\
Signature · 1 line
2.51.0.618.g983fd99d29-goog
Applied
#4 lore raw

Re: (subset) [PATCH v2] tools headers: kcfi: rename missed CONFIG_CFI_CLANG

Quoted 8 lines · Carlos Llamas

Commit 23ef9d439769 ("kcfi: Rename CONFIG_CFI_CLANG to CONFIG_CFI") missed one instance of CONFIG_CFI_CLANG. Rename it to match the original kernel header. This addresses the following build warning:

Warning: Kernel ABI header differences:
diff -u tools/include/linux/cfi_types.h include/linux/cfi_types.h

[...]

Applied to for-next/hardening, thanks!

[1/1] tools headers: kcfi: rename missed CONFIG_CFI_CLANG

      https://git.kernel.org/kees/c/b157dd228cf0

Take care,

Signature · 1 line
Kees Cook