diff options
| -rw-r--r-- | arch/x86/include/asm/processor.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/ptrace.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index fc801bab1b3b..b753ea59703a 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h | |||
| @@ -450,6 +450,8 @@ struct thread_struct { | |||
| 450 | struct perf_event *ptrace_bps[HBP_NUM]; | 450 | struct perf_event *ptrace_bps[HBP_NUM]; |
| 451 | /* Debug status used for traps, single steps, etc... */ | 451 | /* Debug status used for traps, single steps, etc... */ |
| 452 | unsigned long debugreg6; | 452 | unsigned long debugreg6; |
| 453 | /* Keep track of the exact dr7 value set by the user */ | ||
| 454 | unsigned long ptrace_dr7; | ||
| 453 | /* Fault info: */ | 455 | /* Fault info: */ |
| 454 | unsigned long cr2; | 456 | unsigned long cr2; |
| 455 | unsigned long trap_no; | 457 | unsigned long trap_no; |
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 017d937639fe..0c1033d61e59 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
| @@ -702,7 +702,7 @@ static unsigned long ptrace_get_debugreg(struct task_struct *tsk, int n) | |||
| 702 | } else if (n == 6) { | 702 | } else if (n == 6) { |
| 703 | val = thread->debugreg6; | 703 | val = thread->debugreg6; |
| 704 | } else if (n == 7) { | 704 | } else if (n == 7) { |
| 705 | val = ptrace_get_dr7(thread->ptrace_bps); | 705 | val = thread->ptrace_dr7; |
| 706 | } | 706 | } |
| 707 | return val; | 707 | return val; |
| 708 | } | 708 | } |
| @@ -778,8 +778,11 @@ int ptrace_set_debugreg(struct task_struct *tsk, int n, unsigned long val) | |||
| 778 | return rc; | 778 | return rc; |
| 779 | } | 779 | } |
| 780 | /* All that's left is DR7 */ | 780 | /* All that's left is DR7 */ |
| 781 | if (n == 7) | 781 | if (n == 7) { |
| 782 | rc = ptrace_write_dr7(tsk, val); | 782 | rc = ptrace_write_dr7(tsk, val); |
| 783 | if (!rc) | ||
| 784 | thread->ptrace_dr7 = val; | ||
| 785 | } | ||
| 783 | 786 | ||
| 784 | ret_path: | 787 | ret_path: |
| 785 | return rc; | 788 | return rc; |
