scripts: syscall: require a complete ABI name match
PATCH 1/1 scripts: syscall: require a complete ABI name match
From: Hamdy Abou El Anein <[email protected]>
The --abis expression has no boundary after the ABI alternatives. Selecting common also selects common32 in a table containing both, which can include unwanted entries and inflate the syscall count.
Require whitespace after an explicitly selected ABI. Leave the default expression unchanged so that omitting --abis still selects every entry.
Tested all three generators with a synthetic table containing common, common32 and other. Single and multiple selections exclude common32, while the default includes it. Generated headers and a syscall table also compile with GCC -Wall -Wextra -Werror.
This is a selector-contract test; no current in-tree table with this particular prefix collision has been identified.
AI assistance: ChatGPT/Codex identified the issue and prepared the change, commit message and executable regression tests.
--- scripts/syscallhdr.sh | 2 +- scripts/syscallnr.sh | 2 +- scripts/syscalltbl.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
scripts/syscallhdr.sh +1 -1
@@ -39,7 +39,7 @@ while [ $# -gt 0 ] do case $1 in --abis) - abis=$(echo "($2)" | tr ',' '|') + abis=$(echo "($2)[[:space:]]" | tr ',' '|') shift 2;; --emit-nr) emit_nr=1
scripts/syscallnr.sh +1 -1
@@ -34,7 +34,7 @@ while [ $# -gt 0 ] do case $1 in --abis) - abis=$(echo "($2)" | tr ',' '|') + abis=$(echo "($2)[[:space:]]" | tr ',' '|') shift 2;; --prefix) prefix=$2
scripts/syscalltbl.sh +1 -1
@@ -33,7 +33,7 @@ while [ $# -gt 0 ] do case $1 in --abis) - abis=$(echo "($2)" | tr ',' '|') + abis=$(echo "($2)[[:space:]]" | tr ',' '|') shift 2;; -*) echo "$1: unknown option" >&2
Nathan Chancellor
maintainerQuoted 5 lines · Hamdy Abou El Anein
From: Hamdy Abou El Anein <[email protected]>
The --abis expression has no boundary after the ABI alternatives. Selecting common also selects common32 in a table containing both, which can include unwanted entries and inflate the syscall count.
These scripts are getting an overhaul and I think this bug is fixed as part of that series:
https://lore.kernel.org/[email protected]/
Signature · 2 lines
Cheers, Nathan