]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 17 Sep 2019 16:02:18 +0000 (18:02 +0200)
commit27357c280a3f5e02b148a39b1887cd997cbd1fe9
tree9b59b7022db86de7b01617fbd6da083ab12098be
parent4fee1df6f76bb4f07cf2c0ecdb9b9f31c3ff1656
perf header: Fix divide by zero error if f_header.attr_size==0

BugLink: https://bugs.launchpad.net/bugs/1841652
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
tools/perf/util/header.c