lkml.org 
[lkml]   [2014]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 3.16] x86,kprobes: Don't try to resolve kprobe faults from userspace
(2014/07/12 2:27), Andy Lutomirski wrote:
> This commit:
>
> commit 6f6343f53d133bae516caf3d254bce37d8774625
> Author: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
> Date: Thu Apr 17 17:17:33 2014 +0900
>
> kprobes/x86: Call exception handlers directly from do_int3/do_debug
>
> appears to have inadvertently dropped a check that the int3 came
> from kernel mode. Trying to dereference addr when addr is
> user-controlled is completely bogus.

Oops, right!

Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>

Thank you very much!

>
> Signed-off-by: Andy Lutomirski <luto@amacapital.net>
> ---
>
> Changes from v1: Fixed the changelog message
>
> arch/x86/kernel/kprobes/core.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
> index 7596df6..67e6d19 100644
> --- a/arch/x86/kernel/kprobes/core.c
> +++ b/arch/x86/kernel/kprobes/core.c
> @@ -574,6 +574,9 @@ int kprobe_int3_handler(struct pt_regs *regs)
> struct kprobe *p;
> struct kprobe_ctlblk *kcb;
>
> + if (user_mode_vm(regs))
> + return 0;
> +
> addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t));
> /*
> * We don't want to be preempted for the entire
>


--
Masami HIRAMATSU
Software Platform Research Dept. Linux Technology Research Center
Hitachi, Ltd., Yokohama Research Laboratory
E-mail: masami.hiramatsu.pt@hitachi.com




\
 
 \ /
  Last update: 2014-07-14 01:21    [W:0.101 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site