]> www.infradead.org Git - users/dwmw2/linux.git/commit
perf header: Fix divide by zero error if f_header.attr_size==0
authorVince Weaver <vincent.weaver@maine.edu>
Tue, 23 Jul 2019 15:06:01 +0000 (11:06 -0400)
committerSasha Levin <sashal@kernel.org>
Sun, 25 Aug 2019 14:10:28 +0000 (10:10 -0400)
commit4b6da8b8ecccd1fec368ac5920b5139be0ce7e2f
treee28a9bb468759acddbda503cffe962023d36617e
parent33c901020ab3583087ebb40d75f8d45ab93110c1
perf header: Fix divide by zero error if f_header.attr_size==0

[ Upstream commit 7622236ceb167aa3857395f9bdaf871442aa467e ]

So I have been having lots of trouble with hand-crafted perf.data files
causing segfaults and the like, so I have started fuzzing the perf tool.

First issue found:

If f_header.attr_size is 0 in the perf.data file, then perf will crash
with a divide-by-zero error.

Committer note:

Added a pr_err() to tell the user why the command failed.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1907231100440.14532@macbook-air
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/util/header.c