diff options
author | Andy Lutomirski <luto@amacapital.net> | 2014-07-11 13:27:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-07-16 08:16:32 -0400 |
commit | 0cdd192cf40fb6dbf03ec3af1c670068de3fd26c (patch) | |
tree | cff55fbed83fc33982dd8b6226124731793a84c3 /arch | |
parent | 4485154138f6ffa5b252cb490aba3e8eb30124e4 (diff) |
kprobes/x86: Don't try to resolve kprobe faults from userspace
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.
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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/kprobes/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 7596df664901..67e6d19ef1be 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) | |||
574 | struct kprobe *p; | 574 | struct kprobe *p; |
575 | struct kprobe_ctlblk *kcb; | 575 | struct kprobe_ctlblk *kcb; |
576 | 576 | ||
577 | if (user_mode_vm(regs)) | ||
578 | return 0; | ||
579 | |||
577 | addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t)); | 580 | addr = (kprobe_opcode_t *)(regs->ip - sizeof(kprobe_opcode_t)); |
578 | /* | 581 | /* |
579 | * We don't want to be preempted for the entire | 582 | * We don't want to be preempted for the entire |