From: sashiko-bot@kernel.org
To: "Thomas Richter" <tmricht@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, "Vasily Gorbik" <gor@linux.ibm.com>,
linux-perf-users@vger.kernel.org,
"Heiko Carstens" <hca@linux.ibm.com>,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH v2] perf test: perftool-testsuite-report fails on s390
Date: Thu, 09 Jul 2026 07:42:14 +0000 [thread overview]
Message-ID: <20260709074215.594AE1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709073024.3778237-1-tmricht@linux.ibm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Uninitialized `perf_config_tmp` leads to arbitrary file deletion via environment injection on non-s390x architectures.
--
--- Patch [1]: [PATCH v2] perf test: perftool-testsuite-report fails on s390 ---
commit f7fabccf09a26131ccc43cc43ec7cc1971402aa3
Author: Thomas Richter <tmricht@linux.ibm.com>
perf test: perftool-testsuite-report fails on s390
This commit addresses a timeout failure in the perftool-testsuite-report
test on s390 architectures. It creates a temporary perf configuration file
to suppress addr2line warnings specifically for s390x systems.
> diff --git a/tools/perf/tests/shell/perftool-testsuite_report.sh b/tools/perf/tests/shell/perftool-testsuite_report.sh
> --- a/tools/perf/tests/shell/perftool-testsuite_report.sh
> +++ b/tools/perf/tests/shell/perftool-testsuite_report.sh
> @@ -6,6 +6,14 @@ test -d "$(dirname "$0")/base_report" || exit 2
> cd "$(dirname "$0")/base_report" || exit 2
> status=0
>
> +# On s390 the default timeout for addr2line is too short, disable warnings
> +if [ $(uname -m) = s390x ]
> +then
> + perf_config_tmp=$(mktemp /tmp/.perfconfig_XXXXX)
> + export PERF_CONFIG="${perf_config_tmp}"
> + perf config 'core.addr2line-disable-warn = true'
> +fi
> +
> PERFSUITE_RUN_DIR=$(mktemp -d /tmp/"$(basename "$0" .sh)".XXX)
[ ... ]
> @@ -19,5 +27,6 @@ if ! [ "$PERFTEST_KEEP_LOGS" = "y" ]; then
> rm -rf "$PERFSUITE_RUN_DIR"
> fi
>
> +[ -n "${perf_config_tmp}" ] && rm -f "${perf_config_tmp}"
[Severity: High]
Could this lead to unintended file deletion on non-s390x architectures?
Since perf_config_tmp is only conditionally initialized if the architecture
is s390x, any value passed in via the environment will be retained on other
systems.
If a user or orchestration environment sets perf_config_tmp before running
the script, this cleanup path will execute rm -f against that arbitrary
file path.
Would it be safer to explicitly initialize perf_config_tmp to an empty
string at the start of the script?
> test $status -ne 0 && exit 1
> exit 0
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709073024.3778237-1-tmricht@linux.ibm.com?part=1
prev parent reply other threads:[~2026-07-09 7:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 7:30 [PATCH v2] perf test: perftool-testsuite-report fails on s390 Thomas Richter
2026-07-09 7:42 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260709074215.594AE1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tmricht@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox