summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2023-12-15 10:12:21 +0100
committerAlexei Starovoitov <ast@kernel.org>2023-12-15 16:25:55 -0800
commite9d13b9d2f99ccf7afeab490d97eaa5ac9846598 (patch)
tree51bae8a1316eb43a74aefebb60a641c89bba6f9e /arch
parent2cd3e3772e41377f32d6eea643e0590774e9187c (diff)
cfi: Add CFI_NOSEAL()
Add a CFI_NOSEAL() helper to mark functions that need to retain their CFI information, despite not otherwise leaking their address. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20231215092707.669401084@infradead.org Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/cfi.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/include/asm/cfi.h b/arch/x86/include/asm/cfi.h
index 1a50b2cd4713..7cd752557905 100644
--- a/arch/x86/include/asm/cfi.h
+++ b/arch/x86/include/asm/cfi.h
@@ -8,6 +8,7 @@
* Copyright (C) 2022 Google LLC
*/
#include <linux/bug.h>
+#include <asm/ibt.h>
/*
* An overview of the various calling conventions...
@@ -138,4 +139,8 @@ static inline u32 cfi_get_func_hash(void *func)
}
#endif /* CONFIG_CFI_CLANG */
+#if HAS_KERNEL_IBT == 1
+#define CFI_NOSEAL(x) asm(IBT_NOSEAL(__stringify(x)))
+#endif
+
#endif /* _ASM_X86_CFI_H */