From: Ian Rogers <irogers@google.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>,
Adrian Hunter <adrian.hunter@intel.com>,
Kan Liang <kan.liang@linux.intel.com>,
James Clark <james.clark@arm.com>, Leo Yan <leo.yan@linux.dev>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 1/4] perf ui browser: Avoid segv on title
Date: Wed, 8 May 2024 22:32:24 -0700 [thread overview]
Message-ID: <CAP-5=fVKuCb_nCmHyJ2+GZwdv8yUVFBJjpt+Wjy_GcwzrCHN+Q@mail.gmail.com> (raw)
In-Reply-To: <CAM9d7cgw45sv2fLm8Yea_RgrOLswSPErwMORCBaeYVb=OXjnZQ@mail.gmail.com>
On Wed, May 8, 2024 at 10:26 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> On Tue, May 7, 2024 at 8:53 PM Ian Rogers <irogers@google.com> wrote:
> >
> > If the title is NULL then it can lead to a segv.
>
> Just out of curiosity, do you know where it sets to NULL?
Yes, the fixes patch added strdup and zfree, the NULL is coming from the zfree.
Thanks,
Ian
> Thanks,
> Namhyung
>
> >
> > Fixes: 769e6a1e15bd ("perf ui browser: Don't save pointer to stack memory")
> > Signed-off-by: Ian Rogers <irogers@google.com>
> > ---
> > tools/perf/ui/browser.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
> > index c4cdf2ea69b7..19503e838738 100644
> > --- a/tools/perf/ui/browser.c
> > +++ b/tools/perf/ui/browser.c
> > @@ -203,7 +203,7 @@ void ui_browser__refresh_dimensions(struct ui_browser *browser)
> > void ui_browser__handle_resize(struct ui_browser *browser)
> > {
> > ui__refresh_dimensions(false);
> > - ui_browser__show(browser, browser->title, ui_helpline__current);
> > + ui_browser__show(browser, browser->title ?: "", ui_helpline__current);
> > ui_browser__refresh(browser);
> > }
> >
> > --
> > 2.45.0.rc1.225.g2a3ae87e7f-goog
> >
next prev parent reply other threads:[~2024-05-09 5:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 3:52 [PATCH v1 0/4] Segv and RC checking fixes Ian Rogers
2024-05-08 3:52 ` [PATCH v1 1/4] perf ui browser: Avoid segv on title Ian Rogers
2024-05-09 5:26 ` Namhyung Kim
2024-05-09 5:32 ` Ian Rogers [this message]
2024-05-08 3:52 ` [PATCH v1 2/4] perf comm: Fix comm_str__put for reference count checking Ian Rogers
2024-05-08 3:53 ` [PATCH v1 3/4] perf report: Avoid segv in report__setup_sample_type Ian Rogers
2024-05-08 3:53 ` [PATCH v1 4/4] perf thread: Fixes to thread__new Ian Rogers
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='CAP-5=fVKuCb_nCmHyJ2+GZwdv8yUVFBJjpt+Wjy_GcwzrCHN+Q@mail.gmail.com' \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=james.clark@arm.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@linux.dev \
--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 \
--cc=peterz@infradead.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 read-only IMAP folder(s) and NNTP newsgroup(s).