Skip to content

Commit 0cdd192

Browse files
amlutoIngo Molnar
authored andcommitted
kprobes/x86: Don't try to resolve kprobe faults from userspace
This commit: commit 6f6343f 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. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Link: http://lkml.kernel.org/r/c4e339882c121aa76254f2adde3fcbdf502faec2.1405099506.git.luto@amacapital.net Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 4485154 commit 0cdd192

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kernel/kprobes/core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,9 @@ int kprobe_int3_handler(struct pt_regs *regs)
574574
struct kprobe *p;
575575
struct kprobe_ctlblk *kcb;
576576

577+
if (user_mode_vm(regs))
578+
return 0;
579+
577580
addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t));
578581
/*
579582
* We don't want to be preempted for the entire

0 commit comments

Comments
 (0)