Introduce Kconfig option X86_BRANCH_TRACKING_USER.

Indirect Branch Tracking (IBT) provides protection against CALL-/JMP-
oriented programming attacks.  It is active when the kernel has this
feature enabled, and the processor and the application support it.
When this feature is enabled, legacy non-IBT applications continue to
work, but without IBT protection.

Signed-off-by: Yu-cheng Yu <yu-cheng...@intel.com>
---
 arch/x86/Kconfig | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 4b28a0ce4594..15c7f2606c9d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -1966,6 +1966,25 @@ config X86_SHADOW_STACK_USER
 
          If unsure, say N.
 
+config X86_BRANCH_TRACKING_USER
+       prompt "Intel Indirect Branch Tracking for user-mode"
+       def_bool n
+       depends on CPU_SUP_INTEL && X86_64
+       depends on $(cc-option,-fcf-protection)
+       select X86_CET
+       help
+         Indirect Branch Tracking (IBT) provides protection against
+         CALL-/JMP-oriented programming attacks.  It is active when
+         the kernel has this feature enabled, and the processor and
+         the application support it.  When this feature is enabled,
+         legacy non-IBT applications continue to work, but without
+         IBT protection.
+         Support for this feature is only known to be present on
+         processors released in 2020 or later.  CET features are also
+         known to increase kernel text size by 3.7 KB.
+
+         If unsure, say N.
+
 config EFI
        bool "EFI runtime service support"
        depends on ACPI
-- 
2.21.0

Reply via email to