summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/kprobes.c
diff options
context:
space:
mode:
authorMasami Hiramatsu2009-03-16 23:57:22 +0100
committerLinus Torvalds2009-03-17 17:11:48 +0100
commit30390880debce4a68fd23e87a787f27609e4bf4a (patch)
tree8466b965fee089fdafceaeaaf785fdea288b4bbd /arch/x86/kernel/kprobes.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-2.6-dm (diff)
downloadkernel-qcow2-linux-30390880debce4a68fd23e87a787f27609e4bf4a.tar.gz
kernel-qcow2-linux-30390880debce4a68fd23e87a787f27609e4bf4a.tar.xz
kernel-qcow2-linux-30390880debce4a68fd23e87a787f27609e4bf4a.zip
prevent boosting kprobes on exception address
Don't boost at the addresses which are listed on exception tables, because major page fault will occur on those addresses. In that case, kprobes can not ensure that when instruction buffer can be freed since some processes will sleep on the buffer. kprobes-ia64 already has same check. Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com> Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/kernel/kprobes.c')
-rw-r--r--arch/x86/kernel/kprobes.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/x86/kernel/kprobes.c b/arch/x86/kernel/kprobes.c
index e948b28a5a9a..4558dd3918cf 100644
--- a/arch/x86/kernel/kprobes.c
+++ b/arch/x86/kernel/kprobes.c
@@ -193,6 +193,9 @@ static int __kprobes can_boost(kprobe_opcode_t *opcodes)
kprobe_opcode_t opcode;
kprobe_opcode_t *orig_opcodes = opcodes;
+ if (search_exception_tables(opcodes))
+ return 0; /* Page fault may occur on this address. */
+
retry:
if (opcodes - orig_opcodes > MAX_INSN_SIZE - 1)
return 0;