Skip to content

Commit

Permalink
perf traceevent: Ensure read cmdlines are null terminated.
Browse files Browse the repository at this point in the history
commit 137a525 upstream.

Issue detected by address sanitizer.

Fixes: cd4ceb6 ("perf util: Save pid-cmdline mapping into tracing header")
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20210226221431.1985458-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
captain5050 authored and gregkh committed Mar 17, 2021
1 parent ef663d1 commit 4d0273a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/perf/util/trace-event-read.c
Expand Up @@ -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;
Expand Down

0 comments on commit 4d0273a

Please sign in to comment.