]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ptrace/x86: flush_ptrace_hw_breakpoint() shoule clear the virtual debug registers
authorOleg Nesterov <oleg@redhat.com>
Fri, 7 Jun 2013 00:09:37 +0000 (10:09 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 7 Jun 2013 05:43:14 +0000 (15:43 +1000)
commit5b842b6a0c5b04a16642ae9e00a95d33a21b886a
tree750237c3452b3363a250115979fecd157221a86c
parent6e9c53917cb6b9b647a6f085afc731db4307164b
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 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: Oleg Nesterov <oleg@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: Michael Neuling <mikey@neuling.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Prasad <prasad@linux.vnet.ibm.com>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/kernel/hw_breakpoint.c