diff options
| author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-08 14:10:18 +0300 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-06-11 00:56:02 +0300 |
| commit | fd1f70776add263f8ef38a87ae593c75303f1dcd (patch) | |
| tree | 333ec66422307d628728e7c6ecc37a5c90bb9760 /scripts/Makefile.thinlto | |
| parent | 438ece06185696e14c63c6113d5e2d34ec0a9680 (diff) | |
| download | linux-fd1f70776add263f8ef38a87ae593c75303f1dcd.tar.xz | |
tools lib api: Fix mount_overload() snprintf truncation and toupper range
mount_overload() builds an environment variable name like
"PERF_SYSFS_ENVIRONMENT" from fs->name. Two bugs:
1) snprintf() uses name_len as the buffer size instead of sizeof(upper_name).
For fs->name = "sysfs" (len=5), the output is truncated to "PERF" (4
chars + null), so getenv() never finds the intended variable.
2) mem_toupper() only uppercases name_len bytes, converting just the "PERF"
prefix rather than the full string including the filesystem name portion.
Fix by using sizeof(upper_name) for snprintf and strlen(upper_name) for
mem_toupper, so the full "PERF_SYSFS_ENVIRONMENT" string is correctly
formatted and uppercased.
Reported-by: sashiko-bot <sashiko-bot@kernel.org>
Fixes: 73ca85ad364769ff ("tools lib api fs: Add FSTYPE__mount() method")
Cc: Jiri Olsa <jolsa@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
