lkml.org 
[lkml]   [2019]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.0 103/238] x86/kprobes: Prohibit probing on optprobe template code
    Date
    5.0-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Masami Hiramatsu <mhiramat@kernel.org>

    commit 0192e6535ebe9af68614198ced4fd6d37b778ebf upstream.

    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>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    arch/x86/kernel/kprobes/opt.c | 5 +++++
    1 file changed, 5 insertions(+)

    --- a/arch/x86/kernel/kprobes/opt.c
    +++ b/arch/x86/kernel/kprobes/opt.c
    @@ -141,6 +141,11 @@ asm (

    void optprobe_template_func(void);
    STACK_FRAME_NON_STANDARD(optprobe_template_func);
    +NOKPROBE_SYMBOL(optprobe_template_func);
    +NOKPROBE_SYMBOL(optprobe_template_entry);
    +NOKPROBE_SYMBOL(optprobe_template_val);
    +NOKPROBE_SYMBOL(optprobe_template_call);
    +NOKPROBE_SYMBOL(optprobe_template_end);

    #define TMPL_MOVE_IDX \
    ((long)optprobe_template_val - (long)optprobe_template_entry)

    \
     
     \ /
      Last update: 2019-03-22 13:32    [W:4.024 / U:0.480 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site