]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ptrace/x86: ptrace_write_dr7() should create bp if !disabled
authorOleg Nesterov <oleg@redhat.com>
Fri, 7 Jun 2013 00:09:36 +0000 (10:09 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 17 Jun 2013 08:20:18 +0000 (18:20 +1000)
commit8f4a5b9369009e75bb8b43909a4f25f0fe2c13fd
treeb9aed20e0805c839d503230813a17c5cbd769d46
parentdd164d73437e080b9d793137a05e4cef8c066be9
ptrace/x86: ptrace_write_dr7() should create bp if !disabled

24f1e32c ("hw-breakpoints: Rewrite the hw-breakpoints layer on top of perf
events") introduced the minor regression.  Before this commit

PTRACE_POKEUSER DR7, enableDR0
PTRACE_POKEUSER DR0, address

was perfectly valid, now PTRACE_POKEUSER(DR7) fails if DR0 was not
previously initialized by PTRACE_POKEUSER(DR0).

Change ptrace_write_dr7() to do ptrace_register_breakpoint(addr => 0) if
!bp && !disabled.  This fixes watchpoint-zeroaddr from ptrace-tests, see
https://bugzilla.redhat.com/show_bug.cgi?id=660204.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Jan Kratochvil <jan.kratochvil@redhat.com>
Acked-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Ingo Molnar <mingo@kernel.org>
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/ptrace.c