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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-dd004c475cd15a5749b04b0283d41ffdfa57d658@git.kernel.org>
Date:	Thu, 29 Oct 2009 08:08:20 GMT
From:	tip-bot for Masami Hiramatsu <mhiramat@...hat.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	mingo@...hat.com, peterz@...radead.org, fweisbec@...il.com,
	rostedt@...dmis.org, jbaron@...hat.com, tglx@...utronix.de,
	mhiramat@...hat.com, hpa@...or.com, fche@...hat.com,
	linux-kernel@...r.kernel.org, jkenisto@...ibm.com,
	hch@...radead.org, ananth@...ibm.com, srikar@...ux.vnet.ibm.com,
	prasad@...ux.vnet.ibm.com, mingo@...e.hu
Subject: [tip:perf/probes] kprobe-tracer: Compare both of event-name and event-group to find probe

Commit-ID:  dd004c475cd15a5749b04b0283d41ffdfa57d658
Gitweb:     http://git.kernel.org/tip/dd004c475cd15a5749b04b0283d41ffdfa57d658
Author:     Masami Hiramatsu <mhiramat@...hat.com>
AuthorDate: Tue, 27 Oct 2009 16:42:44 -0400
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Thu, 29 Oct 2009 08:47:47 +0100

kprobe-tracer: Compare both of event-name and event-group to find probe

Fix find_probe_event() to compare both of event-name and
event-group. Without this fix, kprobe-tracer overwrites existing
same event-name probe even if its group-name is different.

Signed-off-by: Masami Hiramatsu <mhiramat@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Jim Keniston <jkenisto@...ibm.com>
Cc: Ananth N Mavinakayanahalli <ananth@...ibm.com>
Cc: Christoph Hellwig <hch@...radead.org>
Cc: Frank Ch. Eigler <fche@...hat.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jason Baron <jbaron@...hat.com>
Cc: K.Prasad <prasad@...ux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
LKML-Reference: <20091027204244.30545.27516.stgit@...usame>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
 kernel/trace/trace_kprobe.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index b8ef707..a86c3ac 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -353,12 +353,14 @@ static void free_trace_probe(struct trace_probe *tp)
 	kfree(tp);
 }
 
-static struct trace_probe *find_probe_event(const char *event)
+static struct trace_probe *find_probe_event(const char *event,
+					    const char *group)
 {
 	struct trace_probe *tp;
 
 	list_for_each_entry(tp, &probe_list, list)
-		if (!strcmp(tp->call.name, event))
+		if (strcmp(tp->call.name, event) == 0 &&
+		    strcmp(tp->call.system, group) == 0)
 			return tp;
 	return NULL;
 }
@@ -383,7 +385,7 @@ static int register_trace_probe(struct trace_probe *tp)
 	mutex_lock(&probe_lock);
 
 	/* register as an event */
-	old_tp = find_probe_event(tp->call.name);
+	old_tp = find_probe_event(tp->call.name, tp->call.system);
 	if (old_tp) {
 		/* delete old event */
 		unregister_trace_probe(old_tp);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ