[PATCH] x86: fix debug handler for kmemcheck

From: Vegard Nossum
Date: Thu May 01 2008 - 13:10:07 EST


This changes the 64-bit debug exception handler to match the 32-bit version
(which is also correct).

Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxx>
---
arch/x86/kernel/traps_64.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c
index 8069073..72923ba 100644
--- a/arch/x86/kernel/traps_64.c
+++ b/arch/x86/kernel/traps_64.c
@@ -915,18 +915,13 @@ asmlinkage void __kprobes do_debug(struct pt_regs * regs,

get_debugreg(condition, 6);

-#ifdef CONFIG_KMEMCHECK
/* Catch kmemcheck conditions first of all! */
if (condition & DR_STEP) {
- if (!(regs->flags & X86_VM_MASK) && !user_mode(regs) &&
- ((void *)regs->ip != system_call) &&
- ((void *)regs->ip != x86_debug) &&
- ((void *)regs->ip != ia32_sysenter_target)) {
+ if (kmemcheck_active(regs)) {
kmemcheck_hide(regs);
return;
}
}
-#endif

/*
* The processor cleared BTF, so don't mark that we need it set.
--
1.5.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/