Commit 09b5fa71 authored by Anton Blanchard's avatar Anton Blanchard Committed by Kamal Mostafa

powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH

commit 9a5cbce4 upstream.

We cap 32bit userspace backtraces to PERF_MAX_STACK_DEPTH
(currently 127), but we forgot to do the same for 64bit backtraces.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 97c3d660
...@@ -243,7 +243,7 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry, ...@@ -243,7 +243,7 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
sp = regs->gpr[1]; sp = regs->gpr[1];
perf_callchain_store(entry, next_ip); perf_callchain_store(entry, next_ip);
for (;;) { while (entry->nr < PERF_MAX_STACK_DEPTH) {
fp = (unsigned long __user *) sp; fp = (unsigned long __user *) sp;
if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp)) if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment