Messages in this thread Patch in this message | | | Date | Mon, 16 Mar 2009 18:57:22 -0400 | From | Masami Hiramatsu <> | 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
| |