Files
linux/arch/arm64/kernel
Will Deacon 11b8180292 arm64: ptrace: avoid using HW_BREAKPOINT_EMPTY for disabled events
commit cdc27c2784 upstream.

Commit 8f34a1da35 ("arm64: ptrace: use HW_BREAKPOINT_EMPTY type for
disabled breakpoints") fixed an issue with GDB trying to zero breakpoint
control registers. The problem there is that the arch hw_breakpoint code
will attempt to create a (disabled), execute breakpoint of length 0.

This will fail validation and report unexpected failure to GDB. To avoid
this, we treated disabled breakpoints as HW_BREAKPOINT_EMPTY, but that
seems to have broken with recent kernels, causing watchpoints to be
treated as TYPE_INST in the core code and returning ENOSPC for any
further breakpoints.

This patch fixes the problem by prioritising the `enable' field of the
breakpoint: if it is cleared, we simply update the perf_event_attr to
indicate that the thing is disabled and don't bother changing either the
type or the length. This reinforces the behaviour that the breakpoint
control register is essentially read-only apart from the enable bit
when disabling a breakpoint.

Reported-by: Aaron Liu <liucy214@gmail.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-09 12:24:20 -08:00
..
2012-09-17 13:42:21 +01:00
2012-09-17 13:41:59 +01:00
2012-09-17 13:42:13 +01:00
2012-09-17 13:42:14 +01:00
2012-12-05 11:26:49 +00:00
2012-09-17 13:42:04 +01:00
2013-01-29 16:56:37 +00:00
2012-09-17 13:42:19 +01:00
2013-02-14 09:17:29 -05:00
2012-09-17 10:24:46 +01:00
2013-02-14 09:17:29 -05:00
2012-09-17 13:42:21 +01:00