Skip to content

Commit a72f642

Browse files
cphlipotacmel
authored andcommitted
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>
1 parent dad2762 commit a72f642

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎tools/perf/util/trace-event-info.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ static int record_ftrace_printk(void)
377377

378378
static int record_saved_cmdline(void)
379379
{
380-
unsigned int size;
380+
unsigned long long size;
381381
char *path;
382382
struct stat st;
383383
int ret, err = 0;

0 commit comments

Comments
 (0)