From: tip-bot for Masami Hiramatsu <mhiramat@redhat.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
dle-develop@lists.sourceforge.net, stable@kernel.org,
tglx@linutronix.de, mhiramat@redhat.com, mingo@elte.hu,
systemtap@sources.redhat.com
Subject: [tip:perf/urgent] perf probe: Fix probe_point buffer overrun
Date: Sat, 13 Mar 2010 12:26:00 GMT [thread overview]
Message-ID: <tip-594087a04eea544356f9c52e83c1a9bc380ce80f@git.kernel.org> (raw)
In-Reply-To: <20100312232217.2017.45017.stgit@localhost6.localdomain6>
Commit-ID: 594087a04eea544356f9c52e83c1a9bc380ce80f
Gitweb: http://git.kernel.org/tip/594087a04eea544356f9c52e83c1a9bc380ce80f
Author: Masami Hiramatsu <mhiramat@redhat.com>
AuthorDate: Fri, 12 Mar 2010 18:22:17 -0500
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sat, 13 Mar 2010 08:32:22 +0100
perf probe: Fix probe_point buffer overrun
Fix probe_point array-size overrun problem. In some cases (e.g.
inline function), one user-specified probe-point can be
translated to many probe address, and it overruns pre-defined
array-size. This also removes redundant MAX_PROBES macro
definition.
Signed-off-by: Masami Hiramatsu <mhiramat@redhat.com>
Cc: systemtap <systemtap@sources.redhat.com>
Cc: DLE <dle-develop@lists.sourceforge.net>
Cc: <stable@kernel.org>
LKML-Reference: <20100312232217.2017.45017.stgit@localhost6.localdomain6>
[ Note that only root can create new probes. Eventually we should remove
the MAX_PROBES limit, but that is a larger patch not eligible to
perf/urgent treatment. ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
tools/perf/builtin-probe.c | 1 -
tools/perf/util/probe-finder.c | 3 +++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index c30a335..152d6c9 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -47,7 +47,6 @@
#include "util/probe-event.h"
#define MAX_PATH_LEN 256
-#define MAX_PROBES 128
/* Session management structure */
static struct {
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 1e6c65e..f9cbbf1 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -455,6 +455,9 @@ static void show_probe_point(Dwarf_Die *sp_die, struct probe_finder *pf)
/* *pf->fb_ops will be cached in libdw. Don't free it. */
pf->fb_ops = NULL;
+ if (pp->found == MAX_PROBES)
+ die("Too many( > %d) probe point found.\n", MAX_PROBES);
+
pp->probes[pp->found] = strdup(tmp);
pp->found++;
}
next prev parent reply other threads:[~2010-03-13 12:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-12 23:22 [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Masami Hiramatsu
2010-03-12 23:22 ` [PATCH -tip 2/3] [BUGFIX] perf probe: Fix probe_point buffer overrun Masami Hiramatsu
2010-03-13 12:26 ` tip-bot for Masami Hiramatsu [this message]
2010-03-12 23:22 ` [PATCH -tip 3/3] [BUGFIX] perf probe: Set need_dwarf if lazy matching is used Masami Hiramatsu
2010-03-13 12:26 ` [tip:perf/urgent] perf probe: Fix need_dwarf flag " tip-bot for Masami Hiramatsu
2010-03-13 7:27 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support optimized kprobes Ingo Molnar
2010-03-15 17:00 ` [PATCH -tip v3] " Masami Hiramatsu
2010-03-16 14:47 ` [tip:perf/core] kprobes: Hide CONFIG_OPTPROBES and set if arch supports " tip-bot for Masami Hiramatsu
2010-03-14 0:15 ` [PATCH -tip 1/3] kprobes: Hide CONFIG_OPTPROBES and set if arch support " OGAWA Hirofumi
2010-03-14 2:05 ` 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-594087a04eea544356f9c52e83c1a9bc380ce80f@git.kernel.org \
--to=mhiramat@redhat.com \
--cc=dle-develop@lists.sourceforge.net \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=stable@kernel.org \
--cc=systemtap@sources.redhat.com \
--cc=tglx@linutronix.de \
/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
Powered by JetHome