Skip to content

Commit 9a5cbce

Browse files
antonblanchardmpe
authored andcommitted
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>
1 parent 7debc97 commit 9a5cbce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: arch/powerpc/perf/callchain.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static void perf_callchain_user_64(struct perf_callchain_entry *entry,
243243
sp = regs->gpr[1];
244244
perf_callchain_store(entry, next_ip);
245245

246-
for (;;) {
246+
while (entry->nr < PERF_MAX_STACK_DEPTH) {
247247
fp = (unsigned long __user *) sp;
248248
if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp))
249249
return;

0 commit comments

Comments
 (0)