summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorChris Phlipot <cphlipot0@gmail.com>2018-08-28 23:19:54 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-10-10 08:54:23 +0200
commit4095fd29fee754299221613d0646a93636c48df0 (patch)
tree479260e24159b1a507bfe770cfbe1e68f78e3c0b /tools/perf
parent9d7bc329c123bbdc7db20a02e20e788a91c7c775 (diff)
perf util: Fix bad memory access in trace info.
[ Upstream commit a72f64261359b7451f8478f2a2bf357b4e6c757f ] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf')
-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 e7d60d05596d..8f3b7ef221f2 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -379,7 +379,7 @@ out:
static int record_saved_cmdline(void)
{
- unsigned int size;
+ unsigned long long size;
char *path;
struct stat st;
int ret, err = 0;