@@ -1971,6 +1971,7 @@ config X86_INTEL_BRANCH_TRACKING_USER
select X86_INTEL_CET
select ARCH_HAS_AS_LIMIT
select ARCH_USE_GNU_PROPERTY
+ select ARCH_BINFMT_ELF_STATE
---help---
Indirect Branch Tracking provides hardware protection against return-/jmp-
oriented programming attacks.
@@ -856,6 +856,11 @@ int arch_setup_property(struct arch_elf_state *state)
return r;
}
+ if (cpu_feature_enabled(X86_FEATURE_IBT)) {
+ if (state->gnu_property & GNU_PROPERTY_X86_FEATURE_1_IBT)
+ r = cet_setup_ibt();
+ }
+
return r;
}
#endif
Look in .note.gnu.property of an ELF file and check if Indirect Branch Tracking needs to be enabled for the task. Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com> --- arch/x86/Kconfig | 1 + arch/x86/kernel/process_64.c | 5 +++++ 2 files changed, 6 insertions(+)