@@ -867,22 +867,26 @@ config PROPELLER_CLANG
867867
868868 If unsure, say N.
869869
870- config ARCH_SUPPORTS_CFI_CLANG
870+ config ARCH_SUPPORTS_CFI
871871 bool
872872 help
873- An architecture should select this option if it can support Clang's
874- Control-Flow Integrity (CFI) checking.
873+ An architecture should select this option if it can support Kernel
874+ Control-Flow Integrity (CFI) checking (-fsanitize=kcfi) .
875875
876876config ARCH_USES_CFI_TRAPS
877877 bool
878+ help
879+ An architecture should select this option if it requires the
880+ .kcfi_traps section for KCFI trap handling.
878881
879- config CFI_CLANG
880- bool "Use Clang's Control Flow Integrity (CFI)"
881- depends on ARCH_SUPPORTS_CFI_CLANG
882+ config CFI
883+ bool "Use Kernel Control Flow Integrity (kCFI)"
884+ default CFI_CLANG
885+ depends on ARCH_SUPPORTS_CFI
882886 depends on $(cc-option,-fsanitize=kcfi)
883887 help
884- This option enables Clang's forward-edge Control Flow Integrity
885- (CFI) checking, where the compiler injects a runtime check to each
888+ This option enables forward-edge Control Flow Integrity (CFI)
889+ checking, where the compiler injects a runtime check to each
886890 indirect function call to ensure the target is a valid function with
887891 the correct static type. This restricts possible call targets and
888892 makes it more difficult for an attacker to exploit bugs that allow
@@ -891,10 +895,16 @@ config CFI_CLANG
891895
892896 https://clang.llvm.org/docs/ControlFlowIntegrity.html
893897
898+ config CFI_CLANG
899+ bool
900+ transitional
901+ help
902+ Transitional config for CFI_CLANG to CFI migration.
903+
894904config CFI_ICALL_NORMALIZE_INTEGERS
895905 bool "Normalize CFI tags for integers"
896- depends on CFI_CLANG
897- depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
906+ depends on CFI
907+ depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
898908 help
899909 This option normalizes the CFI tags for integer types so that all
900910 integer types of the same size and signedness receive the same CFI
@@ -907,23 +917,23 @@ config CFI_ICALL_NORMALIZE_INTEGERS
907917
908918 This option is necessary for using CFI with Rust. If unsure, say N.
909919
910- config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
920+ config HAVE_CFI_ICALL_NORMALIZE_INTEGERS
911921 def_bool y
912922 depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers)
913923 # With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826
914924 depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
915925
916926config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC
917927 def_bool y
918- depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG
928+ depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS
919929 depends on RUSTC_VERSION >= 107900
920930 # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373
921931 depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \
922932 (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS)
923933
924934config CFI_PERMISSIVE
925935 bool "Use CFI in permissive mode"
926- depends on CFI_CLANG
936+ depends on CFI
927937 help
928938 When selected, Control Flow Integrity (CFI) violations result in a
929939 warning instead of a kernel panic. This option should only be used
0 commit comments