diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-11 01:33:48 +0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-17 14:28:37 +0300 |
| commit | f973e52a99776fcc473488984828d1fce56d5382 (patch) | |
| tree | 578611efd2f73d3fc8797aedc2ac0db985c99ed8 /scripts/Makefile.thinlto | |
| parent | 063c647b24f640657d6d9e2e90d620ea3ee19ae6 (diff) | |
| download | linux-f973e52a99776fcc473488984828d1fce56d5382.tar.xz | |
perf dso: Fix heap overflow in dso__get_filename() on decompressed path
dso__get_filename() allocates name with malloc(PATH_MAX), but the
dso__filename_with_chroot() path replaces name with an asprintf'd
exact-size string (e.g. 8 bytes for "/a/b.ko"). When the DSO needs
decompression, dso__decompress_kmodule_path() writes the temp path
("/tmp/perf-kmod-XXXXXX", 22 bytes) into newpath, and strcpy(name,
newpath) overflows the smaller allocation.
Replace the strcpy with strdup(newpath) + free(name) so the buffer
is always correctly sized for its content.
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Fixes: 1d6b3c9ba756a513 ("perf tools: Decompress kernel module when reading DSO data")
Reviewed-by: Ian Rogers <irogers@google.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
