diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2019-02-12 11:11:19 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2019-02-13 02:16:39 -0500 |
commit | 0192e6535ebe9af68614198ced4fd6d37b778ebf (patch) | |
tree | 93fb063c1832d1ebde44ad5e8801844e02aaa2cc | |
parent | af63147c1edacfb75a28885a7cd7e6f44e626164 (diff) |
x86/kprobes: Prohibit probing on optprobe template code
Prohibit probing on optprobe template code, since it is not
a code but a template instruction sequence. If we modify
this template, copied template must be broken.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andrea Righi <righi.andrea@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Fixes: 9326638cbee2 ("kprobes, x86: Use NOKPROBE_SYMBOL() instead of __kprobes annotation")
Link: http://lkml.kernel.org/r/154998787911.31052.15274376330136234452.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/kernel/kprobes/opt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/kprobes/opt.c b/arch/x86/kernel/kprobes/opt.c index 6adf6e6c2933..544bd41a514c 100644 --- a/arch/x86/kernel/kprobes/opt.c +++ b/arch/x86/kernel/kprobes/opt.c | |||
@@ -141,6 +141,11 @@ asm ( | |||
141 | 141 | ||
142 | void optprobe_template_func(void); | 142 | void optprobe_template_func(void); |
143 | STACK_FRAME_NON_STANDARD(optprobe_template_func); | 143 | STACK_FRAME_NON_STANDARD(optprobe_template_func); |
144 | NOKPROBE_SYMBOL(optprobe_template_func); | ||
145 | NOKPROBE_SYMBOL(optprobe_template_entry); | ||
146 | NOKPROBE_SYMBOL(optprobe_template_val); | ||
147 | NOKPROBE_SYMBOL(optprobe_template_call); | ||
148 | NOKPROBE_SYMBOL(optprobe_template_end); | ||
144 | 149 | ||
145 | #define TMPL_MOVE_IDX \ | 150 | #define TMPL_MOVE_IDX \ |
146 | ((long)optprobe_template_val - (long)optprobe_template_entry) | 151 | ((long)optprobe_template_val - (long)optprobe_template_entry) |