diff options
author | Ian Rogers <irogers@google.com> | 2025-01-07 21:15:11 -0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2025-01-08 17:40:05 -0300 |
commit | 6bfb4c571b8896df479e6b82a241ea7055ec4b55 (patch) | |
tree | 89183350c49bf5cd679a8a285761cfeabf455263 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 9c64c7c658265f93350aedf77c6b4055ebd71688 (diff) |
perf test cpumap: Avoid use-after-free following merge
Previously cpu maps in the test weren't modified by calls to the cpu map
API, however, perf_cpu_map__merge was modified so the left hand argument
was updated.
In the test this meant the maps copy of the "two" map was put/deleted in
the merge meaning when accessed via maps, the pointer was stale and to
the put/deleted memory.
To fix this add an extra layer of indirection to the maps array, so the
updated value of two is accessed.
Fixes: a9d2217556f7745e ("libperf cpumap: Refactor perf_cpu_map__merge()")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250108051511.1720369-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions