[PATCH v1 RFC Zisslpcfi 01/20] sslp stubs: shadow stack and landing pad stubs

From: Deepak Gupta
Date: Sun Feb 12 2023 - 23:54:14 EST


In absence of shadow stack config and landing pad instr config, stubs are
needed to indicate whether shadow stack & landing pad instr is supported.

In absence of config, these stubs return false (indicating no support)
In presence of config, an extern declaration is added and arch specific
implementation can choose to implement detection.

Signed-off-by: Deepak Gupta <debug@xxxxxxxxxxxx>
---
include/linux/processor.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/include/linux/processor.h b/include/linux/processor.h
index dc78bdc7079a..228aa95a7cd7 100644
--- a/include/linux/processor.h
+++ b/include/linux/processor.h
@@ -59,4 +59,21 @@ do { \

#endif

+#ifndef CONFIG_USER_SHADOW_STACK
+static inline bool arch_supports_shadow_stack(void)
+{
+ return false;
+}
+#else
+extern bool arch_supports_shadow_stack(void);
+#endif
+
+#ifndef CONFIG_USER_INDIRECT_BR_LP
+static inline bool arch_supports_indirect_br_lp_instr(void)
+{
+ return false;
+}
+#else
+extern bool arch_supports_indirect_br_lp_instr(void);
+#endif
#endif /* _LINUX_PROCESSOR_H */
--
2.25.1