Do not seal ENDBR instructions in probestub and traceiter
helpers, as those may be indirectly called via ftrace.
This is required, as __tracepoints section is skipped by
IBT verification in objtool for proper KLP support.

Signed-off-by: Eva Kurchatova <[email protected]>

https://virtuozzo.atlassian.net/browse/VSTOR-131560
Feature: fix tracepoint
---
 include/linux/tracepoint.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 583d962abcc3..41f05599788f 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -19,6 +19,7 @@
 #include <linux/rcupdate.h>
 #include <linux/tracepoint-defs.h>
 #include <linux/static_call.h>
+#include <asm/ibt.h>
 
 struct module;
 struct tracepoint;
@@ -356,7 +357,9 @@ static inline struct tracepoint 
*tracepoint_ptr_deref(tracepoint_ptr_t *p)
        void __probestub_##_name(void *__data, proto)                   \
        {                                                               \
        }                                                               \
-       DEFINE_STATIC_CALL(tp_func_##_name, __traceiter_##_name);
+       DEFINE_STATIC_CALL(tp_func_##_name, __traceiter_##_name);       \
+       asm("" IBT_NOSEAL(__stringify(__probestub_##_name))             \
+           IBT_NOSEAL(__stringify(__traceiter_##_name)));
 
 #define DEFINE_TRACE_FN(_name, _reg, _unreg, _proto, _args)            \
        static struct tracepoint_ext __tracepoint_ext_##_name = {       \
-- 
2.54.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to