[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230213045351.3945824-2-debug@rivosinc.com>
Date: Sun, 12 Feb 2023 20:53:30 -0800
From: Deepak Gupta <debug@...osinc.com>
To: linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Cc: Deepak Gupta <debug@...osinc.com>
Subject: [PATCH v1 RFC Zisslpcfi 01/20] sslp stubs: shadow stack and landing pad stubs
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@...osinc.com>
---
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
Powered by blists - more mailing lists