diff options
| author | Miguel Martín Gil <miguel.martin.gil.uni@gmail.com> | 2026-05-26 13:08:52 +0200 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-05-29 21:17:25 -0300 |
| commit | 167bef4df68635f8bfa2af9108351ee78536d7fb (patch) | |
| tree | 9720cf0cb63ef6694cf6aaa91fe59cc696231b14 /tools/perf/scripts/python/parallel-perf.py | |
| parent | 3dfaf02e554f63f9b4e68b69deda9617a1948993 (diff) | |
perf util: Fix perf_exe() buffer write past end
perf_exe() passes len to readlink() and then unconditionally writes a
trailing NUL at buf[n]. If readlink() returns len, the write lands one
byte past the buffer.
Read at most len - 1 bytes and keep the existing NUL termination. Also
guard the fallback path for tiny buffers so copying "perf" cannot
overflow.
Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Miguel Martín Gil <miguel.martin.gil.uni@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/parallel-perf.py')
0 files changed, 0 insertions, 0 deletions
