diff options
author | Ian Rogers <irogers@google.com> | 2024-02-10 06:17:44 +0300 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2024-02-12 23:35:41 +0300 |
commit | 39a27325e6099e9f9a10d8b5f3b2470a3c10efa5 (patch) | |
tree | 408c5e465935ca0fa8da2244f6e65ba1c3b42e4b /tools/perf/util/setns.c | |
parent | 107ef66cb054f8d54e336236a31631a8cc167c1f (diff) | |
download | linux-39a27325e6099e9f9a10d8b5f3b2470a3c10efa5.tar.xz |
perf maps: Get map before returning in maps__find_next_entry
Finding a map is done under a lock, returning the map without a
reference count means it can be removed without notice and causing
uses after free. Grab a reference count to the map within the lock
region and return this. Fix up locations that need a map__put
following this.
Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: James Clark <james.clark@arm.com>
Cc: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Changbin Du <changbin.du@huawei.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Song Liu <song@kernel.org>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Artem Savkov <asavkov@redhat.com>
Cc: bpf@vger.kernel.org
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240210031746.4057262-5-irogers@google.com
Diffstat (limited to 'tools/perf/util/setns.c')
0 files changed, 0 insertions, 0 deletions