diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-11 02:34:38 +0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-17 14:28:44 +0300 |
| commit | 7b0df6f4d498b1608afccfd6dffb264e6da91693 (patch) | |
| tree | 6fc02fbcedad3e62631713c8ec5e0713595798ff /scripts | |
| parent | d2c6069d68ee9d53b05fe38bc2049cc4286fbb16 (diff) | |
| download | linux-7b0df6f4d498b1608afccfd6dffb264e6da91693.tar.xz | |
perf tools: Use snprintf() for root_dir path construction
get_kernel_version() in machine.c and dso__load_guest_kernel_sym() in
symbol.c use sprintf() to construct paths by prepending root_dir to
"/proc/version" and "/proc/kallsyms" respectively. Both write into
PATH_MAX stack buffers, but root_dir comes from --guestmount or KVM
configuration and is not length-checked. A root_dir at or near
PATH_MAX causes a stack buffer overflow.
Switch to snprintf() with sizeof(path) to prevent overflow.
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Fixes: a1645ce12adb6c9c ("perf: 'perf kvm' tool for monitoring guest performance from host")
Cc: Zhang Yanmin <yanmin_zhang@linux.intel.com>
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
