All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>, Jiri Olsa <jolsa@redhat.com>,
	Namhyung Kim <namhyung@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [BUGFIX PATCH] perf/probe: Fix to clear tev->nargs in clear_probe_trace_event()
Date: Fri, 20 Sep 2019 15:31:18 -0300	[thread overview]
Message-ID: <20190920183118.GE4865@kernel.org> (raw)
In-Reply-To: <156856587999.25775.5145779959474477595.stgit@devnote2>

Em Mon, Sep 16, 2019 at 01:44:40AM +0900, Masami Hiramatsu escreveu:
> Since add_probe_trace_event() can reuse tf->tevs[i] after
> calling clear_probe_trace_event(), this can make perf-probe
> crash if the 1st attempt of probe event finding fails to find
> an event argument, and the 2nd attempt fails to find probe point.
> 
> E.g.
>   $ perf probe -D "task_pid_nr tsk"
>   Failed to find 'tsk' in this function.
>   Failed to get entry address of warn_bad_vsyscall
>   Segmentation fault (core dumped)

Thanks, tested and applied!

- Arnaldo
 
> 
> Fixes: 092b1f0b5f9f ("perf probe: Clear probe_trace_event when add_probe_trace_event() fails")
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> Cc: Wang Nan <wangnan0@huawei.com>
> ---
>  tools/perf/util/probe-event.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index b8e0967c5c21..91cab5f669d2 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -2331,6 +2331,7 @@ void clear_probe_trace_event(struct probe_trace_event *tev)
>  		}
>  	}
>  	zfree(&tev->args);
> +	tev->nargs = 0;
>  }
>  
>  struct kprobe_blacklist_node {

-- 

- Arnaldo

  reply	other threads:[~2019-09-20 18:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-15 16:44 [BUGFIX PATCH] perf/probe: Fix to clear tev->nargs in clear_probe_trace_event() Masami Hiramatsu
2019-09-20 18:31 ` Arnaldo Carvalho de Melo [this message]
2019-09-22 10:52 ` [tip: perf/urgent] perf probe: " tip-bot2 for 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=20190920183118.GE4865@kernel.org \
    --to=arnaldo.melo@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=wangnan0@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.