From: "tip-bot for Naveen N. Rao" <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, ananth@linux.vnet.ibm.com, peterz@infradead.org,
naveen.n.rao@linux.vnet.ibm.com, mingo@kernel.org,
torvalds@linux-foundation.org, mhiramat@kernel.org,
linux-kernel@vger.kernel.org, tglx@linutronix.de
Subject: [tip:perf/urgent] kprobes: Ensure that jprobe probepoints are at function entry
Date: Sat, 8 Jul 2017 04:10:52 -0700 [thread overview]
Message-ID: <tip-dbf580623d5fee785218d1a47a2bcdf36d85c0e9@git.kernel.org> (raw)
In-Reply-To: <a4525af6c5a42df385efa31251246cf7cca73598.1499443367.git.naveen.n.rao@linux.vnet.ibm.com>
Commit-ID: dbf580623d5fee785218d1a47a2bcdf36d85c0e9
Gitweb: http://git.kernel.org/tip/dbf580623d5fee785218d1a47a2bcdf36d85c0e9
Author: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
AuthorDate: Fri, 7 Jul 2017 22:37:26 +0530
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 8 Jul 2017 11:05:35 +0200
kprobes: Ensure that jprobe probepoints are at function entry
Similar to commit 90ec5e89e393c ("kretprobes: Ensure probe location is
at function entry"), ensure that the jprobe probepoint is at function
entry.
Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/a4525af6c5a42df385efa31251246cf7cca73598.1499443367.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/kprobes.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index db3cd3e..a1606a4 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1795,10 +1795,14 @@ int register_jprobe(struct jprobe *jp)
unsigned long addr, offset;
struct kprobe *kp = &jp->kp;
- /* Verify probepoint is a function entry point */
+ /*
+ * Verify probepoint as well as the jprobe handler are
+ * valid function entry points.
+ */
addr = arch_deref_entry_point(jp->entry);
- if (kallsyms_lookup_size_offset(addr, NULL, &offset) && offset == 0) {
+ if (kallsyms_lookup_size_offset(addr, NULL, &offset) && offset == 0 &&
+ kprobe_on_func_entry(kp->addr, kp->symbol_name, kp->offset)) {
kp->pre_handler = setjmp_pre_handler;
kp->break_handler = longjmp_break_handler;
return register_kprobe(kp);
next prev parent reply other threads:[~2017-07-08 11:14 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-07 17:07 [PATCH v2 0/3] kernel/kprobes: A few trivial updates to jprobes Naveen N. Rao
2017-07-07 17:07 ` [PATCH v2 1/3] kernel/kprobes: Rename [arch_]function_offset_within_entry() to [arch_]kprobe_on_func_entry() Naveen N. Rao
2017-07-08 11:10 ` [tip:perf/urgent] kprobes: " tip-bot for Naveen N. Rao
2017-07-07 17:07 ` [PATCH v2 2/3] kernel/kprobes: Simplify register_jprobes() Naveen N. Rao
2017-07-08 11:10 ` [tip:perf/urgent] kprobes: " tip-bot for Naveen N. Rao
2017-07-07 17:07 ` [PATCH v2 3/3] kernel/kprobes: Ensure that jprobe probepoints are at function entry Naveen N. Rao
2017-07-08 11:10 ` tip-bot for Naveen N. Rao [this message]
2017-07-09 12:28 ` [PATCH v2 0/3] kernel/kprobes: A few trivial updates to jprobes Masami Hiramatsu
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=tip-dbf580623d5fee785218d1a47a2bcdf36d85c0e9@git.kernel.org \
--to=tipbot@zytor.com \
--cc=ananth@linux.vnet.ibm.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.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).