diff options
| -rw-r--r-- | arch/x86/include/asm/debugreg.h | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/traps.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/include/asm/debugreg.h b/arch/x86/include/asm/debugreg.h index 8240f76b531e..b81002f23614 100644 --- a/arch/x86/include/asm/debugreg.h +++ b/arch/x86/include/asm/debugreg.h | |||
| @@ -14,6 +14,9 @@ | |||
| 14 | which debugging register was responsible for the trap. The other bits | 14 | which debugging register was responsible for the trap. The other bits |
| 15 | are either reserved or not of interest to us. */ | 15 | are either reserved or not of interest to us. */ |
| 16 | 16 | ||
| 17 | /* Define reserved bits in DR6 which are always set to 1 */ | ||
| 18 | #define DR6_RESERVED (0xFFFF0FF0) | ||
| 19 | |||
| 17 | #define DR_TRAP0 (0x1) /* db0 */ | 20 | #define DR_TRAP0 (0x1) /* db0 */ |
| 18 | #define DR_TRAP1 (0x2) /* db1 */ | 21 | #define DR_TRAP1 (0x2) /* db1 */ |
| 19 | #define DR_TRAP2 (0x4) /* db2 */ | 22 | #define DR_TRAP2 (0x4) /* db2 */ |
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index 33399176512a..1168e4454188 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
| @@ -534,6 +534,9 @@ dotraplinkage void __kprobes do_debug(struct pt_regs *regs, long error_code) | |||
| 534 | 534 | ||
| 535 | get_debugreg(dr6, 6); | 535 | get_debugreg(dr6, 6); |
| 536 | 536 | ||
| 537 | /* Filter out all the reserved bits which are preset to 1 */ | ||
| 538 | dr6 &= ~DR6_RESERVED; | ||
| 539 | |||
| 537 | /* Catch kmemcheck conditions first of all! */ | 540 | /* Catch kmemcheck conditions first of all! */ |
| 538 | if ((dr6 & DR_STEP) && kmemcheck_trap(regs)) | 541 | if ((dr6 & DR_STEP) && kmemcheck_trap(regs)) |
| 539 | return; | 542 | return; |
