summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2018-05-17 15:37:14 +1000
committerBen Hutchings <ben@decadent.org.uk>2018-11-20 18:04:59 +0000
commit5a31ed11c5d4d1ac617039817ce1d59f8dfe40e1 (patch)
tree9cd8c1c307b4dcea506aef3170ea1db83d9348ef /arch/powerpc
parentd6a0144b344591bcd480d8407bc5d88949a0caf3 (diff)
downloadlinux-stable-5a31ed11c5d4d1ac617039817ce1d59f8dfe40e1.tar.gz
linux-stable-5a31ed11c5d4d1ac617039817ce1d59f8dfe40e1.tar.bz2
linux-stable-5a31ed11c5d4d1ac617039817ce1d59f8dfe40e1.zip
powerpc/ptrace: Fix enforcement of DAWR constraints
commit cd6ef7eebf171bfcba7dc2df719c2a4958775040 upstream. Back when we first introduced the DAWR, in commit 4ae7ebe9522a ("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: 4ae7ebe9522a ("powerpc: Change hardware breakpoint to allow longer ranges") Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/hw_breakpoint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/hw_breakpoint.c b/arch/powerpc/kernel/hw_breakpoint.c
index 839b7cd1edc9..3bcecf012a2c 100644
--- a/arch/powerpc/kernel/hw_breakpoint.c
+++ b/arch/powerpc/kernel/hw_breakpoint.c
@@ -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 >