]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf maps: Fix use after free in __maps__fixup_overlap_and_insert
authorIan Rogers <irogers@google.com>
Tue, 21 May 2024 16:51:07 +0000 (09:51 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Fri, 7 Jun 2024 06:30:58 +0000 (23:30 -0700)
commit0b90dfda222e38b7ca8dad6e098e36f5186f0b94
treef9c185e376b377633e96a000368af05a188e1dc7
parenta9700511fd50b9203a9a9d61b4874eb28571d5da
perf maps: Fix use after free in __maps__fixup_overlap_and_insert

In the case 'before' and 'after' are broken out from pos,
maps_by_address may be changed by __maps__insert, as such it needs
re-reading.

Don't ignore the return value from __maps_insert.

Fixes: 659ad3492b91 ("perf maps: Switch from rbtree to lazily sorted array for addresses")
Signed-off-by: Ian Rogers <irogers@google.com>
Reviewed-by: James Clark <james.clark@arm.com>
Cc: Steinar H . Gunderson <sesse@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240521165109.708593-2-irogers@google.com
tools/perf/util/maps.c