linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Leo Yan <leo.yan@linaro.org>
Cc: Namhyung Kim <namhyung@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users <linux-perf-users@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf record: Fix segmentation fault in record__read_lost_samples()
Date: Mon, 26 Sep 2022 14:03:18 +0100	[thread overview]
Message-ID: <YzGjFobeqkrilrEj@kernel.org> (raw)
In-Reply-To: <Yy+rBbzvoTWOI+SJ@leoy-huanghe>

Em Sun, Sep 25, 2022 at 09:12:37AM +0800, Leo Yan escreveu:
> Hi Namhyung,
> 
> On Sat, Sep 24, 2022 at 09:52:09AM -0700, Namhyung Kim wrote:
> 
> [...]
> 
> > > In the unprivileged mode perf fails to open PMU event, the function
> > > record__open() returns error and "session->evlist" is NULL; this leads
> > > to segmentation fault when iterates "session->evlist" in the function
> > > record__read_lost_samples().
> > >
> > > This patch checks "session->evlist" in record__read_lost_samples(), if
> > > "session->evlist" is NULL then the function directly bails out to avoid
> > > segmentation fault.
> > >
> > > Fixes: a49aa8a54e86 ("perf record: Read and inject LOST_SAMPLES events")
> > > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > 
> > Thanks for the fix and sorry for the inconvenience.
> > Actually I sent the same fix a few weeks ago.
> > 
> > https://lore.kernel.org/r/20220909235024.278281-1-namhyung@kernel.org
> 
> Thanks a lot for the info and fix.  The patch in above link looks good
> to me!  Please ignore this one.

Took that as an Acked-by: Leo, thanks!

- Arnaldo

  reply	other threads:[~2022-09-26 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-24 11:33 [PATCH] perf record: Fix segmentation fault in record__read_lost_samples() Leo Yan
2022-09-24 16:52 ` Namhyung Kim
2022-09-25  1:12   ` Leo Yan
2022-09-26 13:03     ` Arnaldo Carvalho de Melo [this message]
2022-09-26 12:59   ` Arnaldo Carvalho de Melo
2022-09-26 14:54     ` Leo Yan
2022-09-26 19:16       ` Arnaldo Carvalho de Melo

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=YzGjFobeqkrilrEj@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    /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).