diff options
author | Masami Hiramatsu <mhiramat@redhat.com> | 2009-03-16 18:57:22 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-17 09:11:48 -0700 |
commit | 30390880debce4a68fd23e87a787f27609e4bf4a (patch) | |
tree | 8466b965fee089fdafceaeaaf785fdea288b4bbd /arch/x86/kernel/kprobes.c | |
parent | 18439c39e826191c0ef08c3a3271ce7ece46a860 (diff) | |
download | linux-30390880debce4a68fd23e87a787f27609e4bf4a.tar.gz linux-30390880debce4a68fd23e87a787f27609e4bf4a.tar.bz2 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.c | 3 |
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; |