[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220218171410.239673712@infradead.org>
Date: Fri, 18 Feb 2022 17:49:30 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: x86@...nel.org, joao@...rdrivepizza.com, hjl.tools@...il.com,
jpoimboe@...hat.com, andrew.cooper3@...rix.com
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org,
ndesaulniers@...gle.com, keescook@...omium.org,
samitolvanen@...gle.com, mark.rutland@....com,
alyssa.milburn@...el.com
Subject: [PATCH 28/29] x86/ibt: Ensure module init/exit points have references
Since the references to the module init/exit points only have external
references, a module LTO run will consider them 'unused' and seal
them, leading to an immediate fail on module load.
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
include/linux/cfi.h | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
--- a/include/linux/cfi.h
+++ b/include/linux/cfi.h
@@ -34,8 +34,17 @@ static inline void cfi_module_remove(str
#else /* !CONFIG_CFI_CLANG */
-#define __CFI_ADDRESSABLE(fn, __attr)
+#ifdef CONFIG_X86_IBT
+
+#define __CFI_ADDRESSABLE(fn, __attr) \
+ const void *__cfi_jt_ ## fn __visible __attr = (void *)&fn
+
+#endif /* CONFIG_X86_IBT */
#endif /* CONFIG_CFI_CLANG */
+#ifndef __CFI_ADDRESSABLE
+#define __CFI_ADDRESSABLE(fn, __attr)
+#endif
+
#endif /* _LINUX_CFI_H */
Powered by blists - more mailing lists