提交 dbf58062 编写于 作者: N Naveen N. Rao 提交者: Ingo Molnar

kprobes: Ensure that jprobe probepoints are at function entry

Similar to commit 90ec5e89 ("kretprobes: Ensure probe location is
at function entry"), ensure that the jprobe probepoint is at function
entry.
Signed-off-by: NNaveen 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.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
上级 0f73ff80
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册