Skip to content

Commit

Permalink
powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Anton Blanchard authored and Michael Ellerman committed Apr 14, 2015
1 parent 7debc97 commit 9a5cbce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/powerpc/perf/callchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9a5cbce

Please sign in to comment.