diff options
| author | Ian Rogers <irogers@google.com> | 2026-06-15 18:15:41 -0700 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-06-30 10:17:18 -0700 |
| commit | c52b600dbee982ef0c81becffe228fe3ab6bd8e3 (patch) | |
| tree | 9ae79160e87da0284da03d74b77531b9b5469bac /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | 054d1c7717b95d9089cd3b80e9e85fe1f2ea0471 (diff) | |
perf python: Add type checking for parse_events/parse_metrics
The threads and cpus parameters in parse_events and parse_metrics
are parsed with the 'O' format specifier but blindly casted in the
C extension. If a user passes an invalid object type, this leads to
memory corruption when dereferencing the expected struct.
Add runtime PyObject_TypeCheck validations in python.c to safely
raise a TypeError if an invalid object is passed.
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alice Rogers <alice.mei.rogers@gmail.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Leo Yan <leo.yan@linux.dev>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
