summaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/perf_event.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-08-05 11:27:25 +0200
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-08-05 11:27:25 +0200
commitf15bdfe4fb264ac30d9c176f898cbd52cfd1ffa9 (patch)
treed93b59190624c0df80854aff5078c588420c3516 /arch/arm/kernel/perf_event.c
parentMerge branch 'swp' (early part) into for-next (diff)
parentMerge tag 'nommu-for-rmk' of git://git.pengutronix.de/git/ukl/linux into deve... (diff)
downloadlinux-f15bdfe4fb264ac30d9c176f898cbd52cfd1ffa9.tar.xz
linux-f15bdfe4fb264ac30d9c176f898cbd52cfd1ffa9.zip
Merge branch 'devel-stable' into for-next
Conflicts: arch/arm/kernel/perf_event_cpu.c
Diffstat (limited to 'arch/arm/kernel/perf_event.c')
-rw-r--r--arch/arm/kernel/perf_event.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index ae3e216a52c2..266cba46db3e 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -560,11 +560,16 @@ user_backtrace(struct frame_tail __user *tail,
struct perf_callchain_entry *entry)
{
struct frame_tail buftail;
+ unsigned long err;
- /* Also check accessibility of one struct frame_tail beyond */
if (!access_ok(VERIFY_READ, tail, sizeof(buftail)))
return NULL;
- if (__copy_from_user_inatomic(&buftail, tail, sizeof(buftail)))
+
+ pagefault_disable();
+ err = __copy_from_user_inatomic(&buftail, tail, sizeof(buftail));
+ pagefault_enable();
+
+ if (err)
return NULL;
perf_callchain_store(entry, buftail.lr);
@@ -590,6 +595,10 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs)
}
perf_callchain_store(entry, regs->ARM_pc);
+
+ if (!current->mm)
+ return;
+
tail = (struct frame_tail __user *)regs->ARM_fp - 1;
while ((entry->nr < PERF_MAX_STACK_DEPTH) &&