arm64: ptrace: fix compat hardware watchpoint reporting
authorWill Deacon <will.deacon@arm.com>
Fri, 22 Aug 2014 13:13:24 +0000 (14:13 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 22 Jan 2015 21:27:28 +0000 (21:27 +0000)
commit2fee2fdbfb9e95f592c6fbfab263d8dc86d5772e
treefc1cd93baf964e24e1d04400ce2d63b6d81343fe
parent660ba08887a7f4a0a1ac14f6d1693568fa2623fa
arm64: ptrace: fix compat hardware watchpoint reporting

I'm not sure what I was on when I wrote this, but when iterating over
the hardware watchpoint array (hbp_watch_array), our index is off by
ARM_MAX_BRP, so we walk off the end of our thread_struct...

... except, a dodgy condition in the loop means that it never executes
at all (bp cannot be NULL).

This patch fixes the code so that we remove the bp check and use the
correct index for accessing the watchpoint structures.

Cc: <stable@vger.kernel.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
(cherry picked from commit 27d7ff273c2aad37b28f6ff0cab2cfa35b51e648)
Signed-off-by: Mark Brown <broonie@kernel.org>
arch/arm64/include/asm/hw_breakpoint.h
arch/arm64/kernel/ptrace.c