[<prev] [next>] [day] [month] [year] [list]
Message-Id: <6becf74d2eb73d4c9a1f33ef998da6e52a5ed57c.1404442700.git.luto@amacapital.net>
Date: Thu, 3 Jul 2014 19:59:20 -0700
From: Andy Lutomirski <luto@...capital.net>
To: Ingo Molnar <mingo@...hat.com>, x86@...nel.org,
linux-kernel@...r.kernel.org
Cc: Andy Lutomirski <luto@...capital.net>
Subject: [PATCH] x86,kprobes: Don't try to resolve kprobe faults from userspace
This commit:
commit 6f6343f53d133bae516caf3d254bce37d8774625
Author: Masami Hiramatsu <masami.hiramatsu.pt@...achi.com>
Date: Thu Apr 17 17:17:33 2014 +0900
kprobes/x86: Call exception handlers directly from do_int3/do_debug
Trying to dereference addr when addr is user-controlled is
completely bogus.
Signed-off-by: Andy Lutomirski <luto@...capital.net>
---
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
--
1.9.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists