arm64: ptrace: fix compat hardware watchpoint reporting
authorWill Deacon <will.deacon@arm.com>
Fri, 22 Aug 2014 13:13:24 +0000 (14:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:54:07 +0000 (14:54 -0700)
commit73ab9689158dd27735252037e036cd908a0db65a
treeb64abccc5b6d514d38bf25494d8a6460df7d9a63
parent8c1bf5dcfe2ccdb5e514eec86607dbccdfa83096
arm64: ptrace: fix compat hardware watchpoint reporting

commit 27d7ff273c2aad37b28f6ff0cab2cfa35b51e648 upstream.

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.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/hw_breakpoint.h
arch/arm64/kernel/ptrace.c