diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-08-13 12:11:43 -0300 |
|---|---|---|
| committer | Namhyung Kim <namhyung@kernel.org> | 2026-08-15 06:37:00 -0700 |
| commit | 10f452dc2de401be76ae8e7395c9663313df8b53 (patch) | |
| tree | 02730bbdd77eb9416165de5987bfa837f0388a6b /tools/perf/scripts/python/task-analyzer.py | |
| parent | 51a7a9ddcb3ebc86615886b1f44e85bdea9df326 (diff) | |
perf dso: Guard close() against invalid fd in dso__decompress_kmodule_path()
dso__decompress_kmodule_path() unconditionally calls close(fd) on the
return value of decompress_kmodule(). When decompression fails or the
DSO is not compressed, decompress_kmodule() returns -1. close(-1)
fails with EBADF and clobbers errno, which callers up the chain
(dso__get_filename → __open_dso) depend on for error propagation.
Guard the close() call with fd >= 0 so only valid file descriptors are
closed.
Fixes: 42b3fa670825 ("perf tools: Introduce dso__decompress_kmodule_{fd,path}")
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Reviewed-by: Ian Rogers <irogers@google.com>
Assisted-by: Claude:claude-opus-4.6
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/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
