]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.19.7/powerpc-perf-cap-64bit-userspace-backtraces-to-perf_max_stack_depth.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.19.7 / powerpc-perf-cap-64bit-userspace-backtraces-to-perf_max_stack_depth.patch
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
5
6 From: Anton Blanchard <anton@samba.org>
7
8 commit 9a5cbce421a283e6aea3c4007f141735bf9da8c3 upstream.
9
10 We cap 32bit userspace backtraces to PERF_MAX_STACK_DEPTH
11 (currently 127), but we forgot to do the same for 64bit backtraces.
12
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>
16
17 ---
18 arch/powerpc/perf/callchain.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
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
24 sp = regs->gpr[1];
25 perf_callchain_store(entry, next_ip);
26
27 - for (;;) {
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))
31 return;