summaryrefslogtreecommitdiff
path: root/include/linux/static_call.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2020-08-18 15:57:43 +0200
committerIngo Molnar <mingo@kernel.org>2020-09-01 09:58:04 +0200
commit6333e8f73b834f54e395a056e6002403f0862c51 (patch)
treee347bbf8a19d2efcdae91fdd8338c8b175ce4cd5 /include/linux/static_call.h
parent9183c3f9ed710a8edf1a61e8a96d497258d26e08 (diff)
static_call: Avoid kprobes on inline static_call()s
Similar to how we disallow kprobes on any other dynamic text (ftrace/jump_label) also disallow kprobes on inline static_call()s. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Link: https://lore.kernel.org/r/20200818135804.744920586@infradead.org
Diffstat (limited to 'include/linux/static_call.h')
-rw-r--r--include/linux/static_call.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 0d7f9efaa3b2..6f62ceda7dd9 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -110,6 +110,7 @@ struct static_call_key {
extern void __static_call_update(struct static_call_key *key, void *tramp, void *func);
extern int static_call_mod_init(struct module *mod);
+extern int static_call_text_reserved(void *start, void *end);
#define DEFINE_STATIC_CALL(name, _func) \
DECLARE_STATIC_CALL(name, _func); \
@@ -153,6 +154,11 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
cpus_read_unlock();
}
+static inline int static_call_text_reserved(void *start, void *end)
+{
+ return 0;
+}
+
#define EXPORT_STATIC_CALL(name) \
EXPORT_SYMBOL(STATIC_CALL_KEY(name)); \
EXPORT_SYMBOL(STATIC_CALL_TRAMP(name))
@@ -182,6 +188,11 @@ void __static_call_update(struct static_call_key *key, void *tramp, void *func)
WRITE_ONCE(key->func, func);
}
+static inline int static_call_text_reserved(void *start, void *end)
+{
+ return 0;
+}
+
#define EXPORT_STATIC_CALL(name) EXPORT_SYMBOL(STATIC_CALL_KEY(name))
#define EXPORT_STATIC_CALL_GPL(name) EXPORT_SYMBOL_GPL(STATIC_CALL_KEY(name))