diff options
author | Jiri Olsa <jolsa@redhat.com> | 2019-07-15 16:21:21 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-16 10:11:05 +0200 |
commit | 1342d61acd12eb2796c40718700cdecfd6b88f81 (patch) | |
tree | 9f6004133d2192d4e631c3a2428ea70f6d57aa9c /tools/arch/arm/include | |
parent | b55b050d9bff898cb6da42383e1e2ae3569ee756 (diff) | |
download | linux-stable-1342d61acd12eb2796c40718700cdecfd6b88f81.tar.gz linux-stable-1342d61acd12eb2796c40718700cdecfd6b88f81.tar.bz2 linux-stable-1342d61acd12eb2796c40718700cdecfd6b88f81.zip |
perf stat: Fix segfault for event group in repeat mode
[ Upstream commit 08ef3af1579d0446db1c1bd08e2c42565addf10f ]
Numfor Mbiziwo-Tiapo reported segfault on stat of event group in repeat
mode:
# perf stat -e '{cycles,instructions}' -r 10 ls
It's caused by memory corruption due to not cleaned evsel's id array and
index, which needs to be rebuilt in every stat iteration. Currently the
ids index grows, while the array (which is also not freed) has the same
size.
Fixing this by releasing id array and zeroing ids index in
perf_evsel__close function.
We also need to keep the evsel_list alive for stat record (which is
disabled in repeat mode).
Reported-by: Numfor Mbiziwo-Tiapo <nums@google.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Mark Drayton <mbd@fb.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <songliubraving@fb.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/20190715142121.GC6032@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools/arch/arm/include')
0 files changed, 0 insertions, 0 deletions