lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-dbf580623d5fee785218d1a47a2bcdf36d85c0e9@git.kernel.org>
Date:   Sat, 8 Jul 2017 04:10:52 -0700
From:   "tip-bot for Naveen N. Rao" <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     hpa@...or.com, ananth@...ux.vnet.ibm.com, peterz@...radead.org,
        naveen.n.rao@...ux.vnet.ibm.com, mingo@...nel.org,
        torvalds@...ux-foundation.org, mhiramat@...nel.org,
        linux-kernel@...r.kernel.org, tglx@...utronix.de
Subject: [tip:perf/urgent] kprobes: Ensure that jprobe probepoints are at
 function entry

Commit-ID:  dbf580623d5fee785218d1a47a2bcdf36d85c0e9
Gitweb:     http://git.kernel.org/tip/dbf580623d5fee785218d1a47a2bcdf36d85c0e9
Author:     Naveen N. Rao <naveen.n.rao@...ux.vnet.ibm.com>
AuthorDate: Fri, 7 Jul 2017 22:37:26 +0530
Committer:  Ingo Molnar <mingo@...nel.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@...ux.vnet.ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/a4525af6c5a42df385efa31251246cf7cca73598.1499443367.git.naveen.n.rao@linux.vnet.ibm.com
Signed-off-by: Ingo Molnar <mingo@...nel.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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ