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>
This commit is contained in:
Masami Hiramatsu 2009-03-16 18:57:22 -04:00 committed by Linus Torvalds
parent 18439c39e8
commit 30390880de

View file

@ -193,6 +193,9 @@ static int __kprobes can_boost(kprobe_opcode_t *opcodes)
kprobe_opcode_t opcode; kprobe_opcode_t opcode;
kprobe_opcode_t *orig_opcodes = opcodes; kprobe_opcode_t *orig_opcodes = opcodes;
if (search_exception_tables(opcodes))
return 0; /* Page fault may occur on this address. */
retry: retry:
if (opcodes - orig_opcodes > MAX_INSN_SIZE - 1) if (opcodes - orig_opcodes > MAX_INSN_SIZE - 1)
return 0; return 0;