From: sashiko-bot@kernel.org
To: "André Almeida" <andrealmeid@igalia.com>
Cc: "Alexander Gordeev" <agordeev@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
linux-s390@vger.kernel.org, "Vasily Gorbik" <gor@linux.ibm.com>
Subject: Re: [PATCH v6 10/13] syscalls: Add an option for offsetting the common table
Date: Fri, 28 Aug 2026 23:34:26 +0000 [thread overview]
Message-ID: <20260828233427.100041F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828-tonyk-syscall_table-v6-10-fdd358456cf1@igalia.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The script `scripts/syscalltbl.sh` inadvertently includes dead code checking for an uninitialized `$offset` variable, which can break the build if inherited from the environment.
--
commit 4e263c69abbb8a963d9217a6ad52a5803ed295f2
Author: André Almeida <andrealmeid@igalia.com>
syscalls: Add an option for offsetting the common table
This commit adds a --common-offset option to the scripts generating syscall
headers and tables. This allows the common syscall table to be offset by a
specified value. It is intended to help architectures like alpha reuse the
common table.
> diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
> index f5b95b19ac92d..eaad7be4c3936 100755
> --- a/scripts/syscalltbl.sh
> +++ b/scripts/syscalltbl.sh
[ ... ]
> @@ -59,14 +64,23 @@ outfile="$2"
>
> nxt=0
>
> -# gen_tbl(infile)
> +# gen_tbl(infile, offset_nr)
> gen_tbl() {
> input=$1
> tmpfile=$(mktemp -p .)
> + offset_nr=$2
>
> grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
> while read nr abi name native compat noreturn; do
>
> + if [ -n "$offset_nr" ]; then
> + nr=$((nr + offset_nr))
> + fi
> +
> + if [ -n "$offset" ]; then
> + nr="($offset + $nr)"
> + fi
[Severity: Low]
Does this code inadvertently use an uninitialized $offset variable?
The script scripts/syscalltbl.sh does not initialize the $offset variable
like scripts/syscallhdr.sh does. If an offset environment variable happens
to be exported by the user or CI, this condition evaluates to true, and nr
is modified into a string.
The subsequent check [ $nxt -gt $nr ] strictly requires an integer and would
fail with a shell syntax error, halting the build.
Was this block copied from scripts/syscallhdr.sh by mistake?
> +
> if [ $nxt -gt $nr ]; then
> echo "error: $input: syscall table is not sorted or duplicates the same syscall number" >&2
> exit 1
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828-tonyk-syscall_table-v6-0-fdd358456cf1@igalia.com?part=10
next prev parent reply other threads:[~2026-08-28 23:34 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 23:19 [PATCH v6 00/13] syscalls: Add a shared table for all archs André Almeida
2026-08-28 23:19 ` [PATCH v6 01/13] syscalls: Make --abis parsing more robust André Almeida
2026-08-28 23:32 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 02/13] syscalls: Create unified partial table for all archs André Almeida
2026-08-28 23:31 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 03/13] scripts/syscall.tbl: Use the common table André Almeida
2026-08-28 23:32 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 04/13] arm: Use the common syscall table André Almeida
2026-08-28 23:35 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 05/13] s390: " André Almeida
2026-08-28 23:27 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 06/13] sparc: " André Almeida
2026-08-28 23:26 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 07/13] mips: Remove duplicated syscallnr.sh André Almeida
2026-08-28 23:27 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 08/13] mips: Get rid of custom mips ABIs for syscall tables André Almeida
2026-08-28 23:29 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 09/13] mips: Use the common syscall table André Almeida
2026-08-28 23:35 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 10/13] syscalls: Add an option for offsetting the common table André Almeida
2026-08-28 23:34 ` sashiko-bot [this message]
2026-08-28 23:19 ` [PATCH v6 11/13] alpha: Define entry point for set_mempolicy_home_node syscall André Almeida
2026-08-28 23:32 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 12/13] alpha: Remove alpha_ prefix from custom syscall entries André Almeida
2026-08-28 23:35 ` sashiko-bot
2026-08-28 23:19 ` [PATCH v6 13/13] alpha: Use the common syscall table André Almeida
2026-08-28 23:39 ` sashiko-bot
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=20260828233427.100041F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=agordeev@linux.ibm.com \
--cc=andrealmeid@igalia.com \
--cc=borntraeger@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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