lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] perf trace: Ensure read cmdlines are null terminated.
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
>

\
 
 \ /
  Last update: 2021-03-01 08:52    [W:0.113 / U:6.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site