summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Phlipot <cphlipot0@gmail.com>2018-08-29 08:19:54 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-08-30 19:50:50 +0200
commita72f64261359b7451f8478f2a2bf357b4e6c757f (patch)
treec949ef4467a0aeee58d78975fadc7b821d9f728c
parentperf tools: Streamline bpf examples and headers installation (diff)
downloadlinux-a72f64261359b7451f8478f2a2bf357b4e6c757f.tar.xz
linux-a72f64261359b7451f8478f2a2bf357b4e6c757f.zip
perf util: Fix bad memory access in trace info.
In the write to the output_fd in the error condition of record_saved_cmdline(), we are writing 8 bytes from a memory location on the stack that contains a primitive that is only 4 bytes in size. Change the primitive to 8 bytes in size to match the size of the write in order to avoid reading unknown memory from the stack. Signed-off-by: Chris Phlipot <cphlipot0@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20180829061954.18871-1-cphlipot0@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/trace-event-info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index c85d0d1a65ed..7b0ca7cbb7de 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -377,7 +377,7 @@ out:
static int record_saved_cmdline(void)
{
- unsigned int size;
+ unsigned long long size;
char *path;
struct stat st;
int ret, err = 0;