Linux s390 Architecture development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "André Almeida" <andrealmeid@igalia.com>,
	"Masami Hiramatsu" <mhiramat@kernel.org>,
	"Arnd Bergmanon" <arnd@arndb.de>
Cc: "Christian Brauner" <brauner@kernel.org>,
	linux-kbuild@vger.kernel.org, kernel-dev@igalia.com,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	linux-s390@vger.kernel.org, sparclinux@vger.kernel.org,
	"Arnaldo Carvalho de Melo" <acme@kernel.org>,
	linux-perf-users@vger.kernel.org,
	"Ingo Molnar" <mingo@redhat.com>,
	"Magnus Lindholm" <linmag7@gmail.com>,
	nathan@kernel.org, nsc@kernel.org,
	"Heiko Carstens" <hca@linux.ibm.com>,
	"Vasily Gorbik" <gor@linux.ibm.com>,
	"Alexander Gordeev" <agordeev@linux.ibm.com>,
	"Christian Borntraeger" <borntraeger@linux.ibm.com>
Subject: Re: [PATCH v10 12/16] syscalls: Avoid matching substrings in the ABI parsing
Date: Fri, 20 Nov 2026 20:23:44 +0000	[thread overview]
Message-ID: <sashiko-outbox-226053@kernel.org> (raw)
In-Reply-To: <20261119-tonyk-syscall_table-v10-12-a7c9ebd900f6@igalia.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] syscalls: gen_hdr() and gen_tbl() regex breaks empty --abis and
  repeats $abis
--

commit f6d8a94774818a17d8d32b3ba41a79a1af1107a1
Author: André Almeida <andrealmeid@igalia.com>

syscalls: Avoid matching substrings in the ABI parsing

This commit updates the grep patterns in scripts/syscallhdr.sh and
scripts/syscalltbl.sh to require trailing whitespace after $abis and
appends "|| true" so the scripts continue to cleanup when grep finds no
matches.

> diff --git a/scripts/syscallhdr.sh b/scripts/syscallhdr.sh
> index f2d670f45ec86..6372dbb1cb715 100755
> --- a/scripts/syscallhdr.sh
> +++ b/scripts/syscallhdr.sh
> @@ -109,7 +109,7 @@ gen_hdr() {
>  	tmpfile=$(mktemp)
>  	offset_nr=$2
>  
> -	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
> +	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis+[[:space:]]" "$input" > $tmpfile || true
> diff --git a/scripts/syscalltbl.sh b/scripts/syscalltbl.sh
> index 1e9cac32c02d2..403a604e7c760 100755
> --- a/scripts/syscalltbl.sh
> +++ b/scripts/syscalltbl.sh
> @@ -70,7 +70,7 @@ gen_tbl() {
>  	tmpfile=$(mktemp)
>  	offset_nr=$2
>  
> -	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis" "$input" > $tmpfile
> +	grep -E "^[0-9A-Fa-fXx]+[[:space:]]+$abis+[[:space:]]" "$input" > $tmpfile || true

[Severity: High]
Does this regex match any lines when --abis is omitted?

When --abis is not passed (such as on m68k, microblaze, sh, and xtensa),
abis defaults to an empty string and the pattern expands to
"^[0-9A-Fa-fXx]+[[:space:]]++[[:space:]]".  That pattern has nothing to
match the ABI column, so grep matches zero lines, "|| true" suppresses the
exit status, and gen_hdr() and gen_tbl() silently generate an empty
syscall_table.h and a unistd header without any __NR_* definitions,
breaking the build on those architectures.

In addition, when --abis is passed, "$abis+[[:space:]]" puts the "+"
quantifier on the parenthesized $abis group rather than on [[:space:]],
matching repeated ABI names instead of one or more trailing whitespace
characters.  Initializing abis to "[^[:space:]]+" by default (or only
requiring trailing whitespace when $abis is non-empty) and moving "+" to
"[[:space:]]+" would avoid both regressions.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-tonyk-syscall_table-v10-0-a7c9ebd900f6@igalia.com?part=12

  reply	other threads:[~2026-11-20 20:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 20:21 [PATCH v10 00/16] syscalls: Add a shared table for all archs André Almeida
2026-11-19 20:21 ` [PATCH v10 01/16] syscalls: Make --abis parsing more robust André Almeida
2026-11-19 20:21 ` [PATCH v10 02/16] syscalls: Create unified partial table for all archs André Almeida
2026-11-20 20:23   ` sashiko-bot
2026-11-19 20:21 ` [PATCH v10 03/16] scripts/syscall.tbl: Use the common table André Almeida
2026-11-19 20:21 ` [PATCH v10 04/16] s390: Use the common syscall table André Almeida
2026-11-19 20:21 ` [PATCH v10 05/16] sparc: " André Almeida
2026-11-19 20:21 ` [PATCH v10 06/16] mips: Remove duplicated syscallnr.sh André Almeida
2026-11-19 20:21 ` [PATCH v10 07/16] mips: Get rid of custom mips ABIs for syscall tables André Almeida
2026-11-19 20:21 ` [PATCH v10 08/16] mips: Use the common syscall table André Almeida
2026-11-19 20:21 ` [PATCH v10 09/16] syscalls: Add an option for offsetting the common table André Almeida
2026-11-19 20:22 ` [PATCH v10 10/16] alpha: Define entry point for set_mempolicy_home_node syscall André Almeida
2026-11-19 20:22 ` [PATCH v10 11/16] alpha: Use the common syscall table André Almeida
2026-11-19 20:22 ` [PATCH v10 12/16] syscalls: Avoid matching substrings in the ABI parsing André Almeida
2026-11-20 20:23   ` sashiko-bot [this message]
2026-11-19 20:22 ` [PATCH v10 13/16] arm: Reorganize syscall table and separated the ABIs André Almeida
2026-11-19 20:22 ` [PATCH v10 14/16] arm: Use common syscall table André Almeida
2026-11-19 20:22 ` [PATCH v10 15/16] perf: Add an option for common table for build_tables() André Almeida
2026-11-19 20:22 ` [PATCH v10 16/16] perf: Synchronize syscall tables with shared table André Almeida
2026-11-20 20:23   ` sashiko-bot
2026-11-20 20:23 ` [PATCH v10 00/16] syscalls: Add a shared table for all archs 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=sashiko-outbox-226053@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=acme@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=andrealmeid@igalia.com \
    --cc=arnd@arndb.de \
    --cc=borntraeger@linux.ibm.com \
    --cc=brauner@kernel.org \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=kernel-dev@igalia.com \
    --cc=linmag7@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=nsc@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=sparclinux@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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