From: jean.pihet@linaro.org (Jean Pihet)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] ARM: perf: Check that current->mm is alive before getting user callchain
Date: Mon, 7 Jul 2014 15:45:08 +0200 [thread overview]
Message-ID: <1404740710-14691-2-git-send-email-jean.pihet@linaro.org> (raw)
In-Reply-To: <1404740710-14691-1-git-send-email-jean.pihet@linaro.org>
An event may occur when an mm is already released.
As per commit 20afc60f892d285fde179ead4b24e6a7938c2f1b
'x86, perf: Check that current->mm is alive before getting user callchain'
Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
Cc: Will Deacon <will.deacon@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
---
arch/arm/kernel/perf_event.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c
index 4238bcb..6493c4c 100644
--- a/arch/arm/kernel/perf_event.c
+++ b/arch/arm/kernel/perf_event.c
@@ -590,6 +590,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) &&
--
1.8.1.2
next prev parent reply other threads:[~2014-07-07 13:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-07 13:45 [PATCH 0/3] ARM: perf: allow tracing with kernel tracepoints events Jean Pihet
2014-07-07 13:45 ` Jean Pihet [this message]
2014-07-07 13:45 ` [PATCH 2/3] ARM: perf: disable the pagefault handler when reading from user space Jean Pihet
2014-07-07 13:45 ` [PATCH 3/3] ARM: perf: allow tracing with kernel tracepoints events Jean Pihet
2014-07-09 14:04 ` [PATCH 0/3] " Will Deacon
-- strict thread matches above, loose matches on Subject: below --
2014-06-27 14:57 Jean Pihet
2014-06-27 14:57 ` [PATCH 1/3] ARM: perf: Check that current->mm is alive before getting user callchain Jean Pihet
2014-07-03 17:53 ` Will Deacon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404740710-14691-2-git-send-email-jean.pihet@linaro.org \
--to=jean.pihet@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).