lkml.org 
[lkml]   [2009]   [Mar]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[BUGFIX][PATCH] 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>
---
arch/x86/kernel/kprobes.c | 3 +++
1 file changed, 3 insertions(+)

Index: mmotm/arch/x86/kernel/kprobes.c
===================================================================
--- mmotm.orig/arch/x86/kernel/kprobes.c
+++ mmotm/arch/x86/kernel/kprobes.c
@@ -193,6 +193,9 @@ static int __kprobes can_boost(kprobe_op
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;
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com




\
 
 \ /
  Last update: 2009-03-17 00:01    [W:0.111 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site