summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
authorRabin Vincent2011-02-09 11:35:12 +0100
committerRussell King2011-02-10 16:29:03 +0100
commitcb06199b1df492fcfbaedd2256b5054f944b664f (patch)
tree910e7c88876d5e56be4d4f96dc1ab99868ec047c /arch/arm/kernel/perf_event.c
parentARM: fixup SMP alternatives in modules (diff)
downloadkernel-qcow2-linux-cb06199b1df492fcfbaedd2256b5054f944b664f.tar.gz
kernel-qcow2-linux-cb06199b1df492fcfbaedd2256b5054f944b664f.tar.xz
kernel-qcow2-linux-cb06199b1df492fcfbaedd2256b5054f944b664f.zip
ARM: 6654/1: perf/oprofile: fix off-by-one in stack check
Since tail is the previous fp - 1, we need to compare the new fp with tail + 1 to ensure that we don't end up passing in the same tail again, in order to avoid a potential infinite loop in the perf interrupt handler (which has been observed to occur). A similar fix seems to be needed in the OProfile code. Acked-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 5efa2647a2fb..d150ad1ccb5d 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -700,7 +700,7 @@ user_backtrace(struct frame_tail __user *tail,
* Frame pointers should strictly progress back up the stack
* (towards higher addresses).
*/
- if (tail >= buftail.fp)
+ if (tail + 1 >= buftail.fp)
return NULL;
return buftail.fp - 1;