summaryrefslogtreecommitdiff
path: root/arch/powerpc/perf/callchain.c
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2015-04-13 21:51:03 (GMT)
committerMichael Ellerman <mpe@ellerman.id.au>2015-04-14 06:21:16 (GMT)
commit9a5cbce421a283e6aea3c4007f141735bf9da8c3 (patch)
tree90dffd2ba5a0ca50e266d41100c8909cc70aebe0 /arch/powerpc/perf/callchain.c
parent7debc970ae7a5573ed43a1dfa242fd1a5390d21a (diff)
downloadlinux-9a5cbce421a283e6aea3c4007f141735bf9da8c3.tar.xz
powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
We cap 32bit userspace backtraces to PERF_MAX_STACK_DEPTH (currently 127), but we forgot to do the same for 64bit backtraces. Cc: stable@vger.kernel.org Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/perf/callchain.c')
-rw-r--r--arch/powerpc/perf/callchain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c
index 2396dda..ead5535 100644
--- a/arch/powerpc/perf/callchain.c
+++ b/arch/powerpc/perf/callchain.c
@@ -243,7 +243,7 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
sp = regs->gpr[1];
perf_callchain_store(entry, next_ip);
- for (;;) {
+ while (entry->nr < PERF_MAX_STACK_DEPTH) {
fp = (unsigned long __user *) sp;
if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp))
return;