projects
/
firefly-linux-kernel-4.4.55.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4485154
)
kprobes/x86: Don't try to resolve kprobe faults from userspace
author
Andy Lutomirski
<luto@amacapital.net>
Fri, 11 Jul 2014 17:27:01 +0000
(10:27 -0700)
committer
Ingo Molnar
<mingo@kernel.org>
Wed, 16 Jul 2014 12:16:32 +0000
(14:16 +0200)
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>
arch/x86/kernel/kprobes/core.c
patch
|
blob
|
history
diff --git
a/arch/x86/kernel/kprobes/core.c
b/arch/x86/kernel/kprobes/core.c
index 7596df664901eed5a7aea5003ab83da49d34a615..67e6d19ef1be65e49a176a1c3bbd43cab654e7f5 100644
(file)
--- 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