1 From 9a5cbce421a283e6aea3c4007f141735bf9da8c3 Mon Sep 17 00:00:00 2001
2 From: Anton Blanchard <anton@samba.org>
3 Date: Tue, 14 Apr 2015 07:51:03 +1000
4 Subject: powerpc/perf: Cap 64bit userspace backtraces to PERF_MAX_STACK_DEPTH
6 From: Anton Blanchard <anton@samba.org>
8 commit 9a5cbce421a283e6aea3c4007f141735bf9da8c3 upstream.
10 We cap 32bit userspace backtraces to PERF_MAX_STACK_DEPTH
11 (currently 127), but we forgot to do the same for 64bit backtraces.
13 Signed-off-by: Anton Blanchard <anton@samba.org>
14 Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
15 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18 arch/powerpc/perf/callchain.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
21 --- a/arch/powerpc/perf/callchain.c
22 +++ b/arch/powerpc/perf/callchain.c
23 @@ -243,7 +243,7 @@ static void perf_callchain_user_64(struc
25 perf_callchain_store(entry, next_ip);
28 + while (entry->nr < PERF_MAX_STACK_DEPTH) {
29 fp = (unsigned long __user *) sp;
30 if (!valid_user_sp(sp, 1) || read_user_stack_64(fp, &next_sp))