Commit f7da04c9 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds

ptrace/x86: flush_ptrace_hw_breakpoint() shoule clear the virtual debug registers

flush_ptrace_hw_breakpoint() destroys the counters set by ptrace, but
"leaks" ->debugreg6 and ->ptrace_dr7.

The problem is minor, but still it doesn't look right and flush_thread()
did this until commit 66cb5917 ("hw-breakpoints: use the new wrapper
routines to access debug registers in process/thread code").  Now that
PTRACE_DETACH does flush_ too this makes even more sense.
Signed-off-by: 's avatarOleg Nesterov <>
Cc: Benjamin Herrenschmidt <>
Cc: Frederic Weisbecker <>
Cc: Ingo Molnar <>
Cc: Jan Kratochvil <>
Cc: Michael Neuling <>
Cc: Paul Mackerras <>
Cc: Paul Mundt <>
Cc: Will Deacon <>
Cc: Prasad <>
Cc: Russell King <>
Signed-off-by: 's avatarAndrew Morton <>
Signed-off-by: 's avatarLinus Torvalds <>
parent fab840fc
......@@ -393,6 +393,9 @@ void flush_ptrace_hw_breakpoint(struct task_struct *tsk)
t->ptrace_bps[i] = NULL;
t->debugreg6 = 0;
t->ptrace_dr7 = 0;
void hw_breakpoint_restore(void)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment