* [PATCH] perf trace: Ensure read cmdlines are null terminated.
@ 2021-02-26 22:14 Ian Rogers
2021-03-01 7:50 ` Namhyung Kim
0 siblings, 1 reply; 3+ messages in thread
From: Ian Rogers @ 2021-02-26 22:14 UTC (permalink / raw)
To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
linux-kernel
Cc: Stephane Eranian, Ian Rogers
Issue detected by address sanitizer.
Fixes: cd4ceb63438e (perf util: Save pid-cmdline mapping into tracing header)
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/util/trace-event-read.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
index f507dff713c9..8a01af783310 100644
--- a/tools/perf/util/trace-event-read.c
+++ b/tools/perf/util/trace-event-read.c
@@ -361,6 +361,7 @@ static int read_saved_cmdline(struct tep_handle *pevent)
pr_debug("error reading saved cmdlines\n");
goto out;
}
+ buf[ret] = '\0';
parse_saved_cmdline(pevent, buf, size);
ret = 0;
--
2.30.1.766.gb4fecdf3b7-goog
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] perf trace: Ensure read cmdlines are null terminated.
2021-02-26 22:14 [PATCH] perf trace: Ensure read cmdlines are null terminated Ian Rogers
@ 2021-03-01 7:50 ` Namhyung Kim
2021-03-02 12:36 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 3+ messages in thread
From: Namhyung Kim @ 2021-03-01 7:50 UTC (permalink / raw)
To: Ian Rogers
Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
Mark Rutland, Alexander Shishkin, Jiri Olsa, linux-kernel,
Stephane Eranian
Hi Ian,
On Sat, Feb 27, 2021 at 7:14 AM Ian Rogers <irogers@google.com> wrote:
>
> Issue detected by address sanitizer.
>
> Fixes: cd4ceb63438e (perf util: Save pid-cmdline mapping into tracing header)
> Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> tools/perf/util/trace-event-read.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
> index f507dff713c9..8a01af783310 100644
> --- a/tools/perf/util/trace-event-read.c
> +++ b/tools/perf/util/trace-event-read.c
> @@ -361,6 +361,7 @@ static int read_saved_cmdline(struct tep_handle *pevent)
> pr_debug("error reading saved cmdlines\n");
> goto out;
> }
> + buf[ret] = '\0';
>
> parse_saved_cmdline(pevent, buf, size);
> ret = 0;
> --
> 2.30.1.766.gb4fecdf3b7-goog
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] perf trace: Ensure read cmdlines are null terminated.
2021-03-01 7:50 ` Namhyung Kim
@ 2021-03-02 12:36 ` Arnaldo Carvalho de Melo
0 siblings, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2021-03-02 12:36 UTC (permalink / raw)
To: Namhyung Kim
Cc: Ian Rogers, Peter Zijlstra, Ingo Molnar, Mark Rutland,
Alexander Shishkin, Jiri Olsa, linux-kernel, Stephane Eranian
Em Mon, Mar 01, 2021 at 04:50:50PM +0900, Namhyung Kim escreveu:
> Hi Ian,
>
> On Sat, Feb 27, 2021 at 7:14 AM Ian Rogers <irogers@google.com> wrote:
> >
> > Issue detected by address sanitizer.
> >
> > Fixes: cd4ceb63438e (perf util: Save pid-cmdline mapping into tracing header)
> > Signed-off-by: Ian Rogers <irogers@google.com>
>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks, applied.
- Arnaldo
> Thanks,
> Namhyung
>
> > ---
> > tools/perf/util/trace-event-read.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/perf/util/trace-event-read.c b/tools/perf/util/trace-event-read.c
> > index f507dff713c9..8a01af783310 100644
> > --- a/tools/perf/util/trace-event-read.c
> > +++ b/tools/perf/util/trace-event-read.c
> > @@ -361,6 +361,7 @@ static int read_saved_cmdline(struct tep_handle *pevent)
> > pr_debug("error reading saved cmdlines\n");
> > goto out;
> > }
> > + buf[ret] = '\0';
> >
> > parse_saved_cmdline(pevent, buf, size);
> > ret = 0;
> > --
> > 2.30.1.766.gb4fecdf3b7-goog
> >
--
- Arnaldo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-02 15:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26 22:14 [PATCH] perf trace: Ensure read cmdlines are null terminated Ian Rogers
2021-03-01 7:50 ` Namhyung Kim
2021-03-02 12:36 ` Arnaldo Carvalho de Melo
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).