diff options
author | Ian Rogers <irogers@google.com> | 2023-04-17 18:51:57 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-04-17 18:51:57 -0300 |
commit | c35ce1d918c12900375a60165c908de47856900d (patch) | |
tree | e7038ce6e6efeaa5f7cfc5822f013cdb14780bb3 /tools/perf/scripts/python/task-analyzer.py | |
parent | 7031edac9dbc0f880c9fbaa40ca08b5de34239c6 (diff) | |
download | linux-c35ce1d918c12900375a60165c908de47856900d.tar.gz linux-c35ce1d918c12900375a60165c908de47856900d.tar.bz2 linux-c35ce1d918c12900375a60165c908de47856900d.zip |
perf namespaces: Add reference count checking
Add reference count checking controlled by REFCNT_CHECKING ifdef. The
reference count checking interposes an allocated pointer between the
reference counted struct on a get and frees the pointer on a put.
Accesses after a put cause faults and use after free, missed puts are
caughts as leaks and double puts are double frees.
This checking helped resolve a memory leak and use after free:
https://lore.kernel.org/linux-perf-users/CAP-5=fWZH20L4kv-BwVtGLwR=Em3AOOT+Q4QGivvQuYn5AsPRg@mail.gmail.com/
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexey Bayduraev <alexey.v.bayduraev@linux.intel.com>
Cc: Dmitriy Vyukov <dvyukov@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Riccardo Mancini <rickyman7@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Link: https://lore.kernel.org/lkml/20230407230405.2931830-4-irogers@google.com
[ Extracted from a larger patch ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions