From: Jiri Olsa <jolsa@redhat.com>
To: Bo YU <tsu.yubo@gmail.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
alexander.shishkin@linux.intel.com, namhyung@kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf trace: Fix potential USE_AFTER_FREE problem
Date: Thu, 14 Feb 2019 09:34:11 +0100 [thread overview]
Message-ID: <20190214083411.GA25842@krava> (raw)
In-Reply-To: <20190214052356.26884-1-tsu.yubo@gmail.com>
On Thu, Feb 14, 2019 at 12:23:56AM -0500, Bo YU wrote:
> From: Bo Yu <tsu.yubo@gmail.com>
>
> There is a freed pointer "evsel", so fix it.
>
> Detected by CoverityScan, CID#1442595("Memory-illegalaccesses
> (USE_AFTER_FREE)")
> Fixes: 6ab3bc240ade4("perf trace: Support multiple "vfs_getname" probes")
>
> Signed-off-by: Bo Yu <tsu.yubo@gmail.com>
> ---
> tools/perf/builtin-trace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
> index b36061cd1ab8..4036b20a1067 100644
> --- a/tools/perf/builtin-trace.c
> +++ b/tools/perf/builtin-trace.c
> @@ -2515,7 +2515,7 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);
> static bool perf_evlist__add_vfs_getname(struct perf_evlist *evlist)
> {
> bool found = false;
> - struct perf_evsel *evsel, *tmp;
> + struct perf_evsel *evsel = NULL, *tmp;
hum, I can't see how this change could matter,
could you pelase explain?
jirka
> struct parse_events_error err = { .idx = 0, };
> int ret = parse_events(evlist, "probe:vfs_getname*", &err);
>
> --
> 2.11.0
>
next prev parent reply other threads:[~2019-02-14 8:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 5:23 [PATCH] perf trace: Fix potential USE_AFTER_FREE problem Bo YU
2019-02-14 8:34 ` Jiri Olsa [this message]
2019-02-14 10:22 ` YU Bo
2019-02-14 11:23 ` Jiri Olsa
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=20190214083411.GA25842@krava \
--to=jolsa@redhat.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=tsu.yubo@gmail.com \
/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).