From: Masami Hiramatsu Date: Mon, 16 Mar 2009 22:57:22 +0000 (-0400) Subject: prevent boosting kprobes on exception address X-Git-Tag: MMI-PSA29.97-13-9~29282 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=30390880debce4a68fd23e87a787f27609e4bf4a;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Cc: Ananth N Mavinakayanahalli Signed-off-by: Linus Torvalds --- 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;