mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
powerpc/ptrace: Fix enforcement of DAWR constraints
commitcd6ef7eebfupstream. Back when we first introduced the DAWR, in commit4ae7ebe952("powerpc: Change hardware breakpoint to allow longer ranges"), we screwed up the constraint making it a 1024 byte boundary rather than a 512. This makes the check overly permissive. Fortunately GDB is the only real user and it always did they right thing, so we never noticed. This fixes the constraint to 512 bytes. Fixes:4ae7ebe952("powerpc: Change hardware breakpoint to allow longer ranges") Cc: stable@vger.kernel.org # v3.9+ Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
b3d0e0f07e
commit
76dcdfe3f6
@@ -174,8 +174,8 @@ int arch_validate_hwbkpt_settings(struct perf_event *bp)
|
||||
if (cpu_has_feature(CPU_FTR_DAWR)) {
|
||||
length_max = 512 ; /* 64 doublewords */
|
||||
/* DAWR region can't cross 512 boundary */
|
||||
if ((bp->attr.bp_addr >> 10) !=
|
||||
((bp->attr.bp_addr + bp->attr.bp_len - 1) >> 10))
|
||||
if ((bp->attr.bp_addr >> 9) !=
|
||||
((bp->attr.bp_addr + bp->attr.bp_len - 1) >> 9))
|
||||
return -EINVAL;
|
||||
}
|
||||
if (info->len >
|
||||
|
||||
Reference in New Issue
Block a user