From: sashiko-bot@kernel.org
To: "André Almeida" <andrealmeid@igalia.com>
Cc: "Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Heiko Carstens" <hca@linux.ibm.com>,
"Vasily Gorbik" <gor@linux.ibm.com>,
linux-s390@vger.kernel.org,
"Alexander Gordeev" <agordeev@linux.ibm.com>
Subject: Re: [PATCH v6 09/13] mips: Use the common syscall table
Date: Fri, 28 Aug 2026 23:35:23 +0000 [thread overview]
Message-ID: <20260828233523.D36BB1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260828-tonyk-syscall_table-v6-9-fdd358456cf1@igalia.com>
Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [Medium] Missing `--abis` flag in `cmd_sysnr` creates a latent out-of-bounds kernel memory access vulnerability on the syscall table.
- [Low] Typo in `rt_sigtimedwait` syscall entry causes linker error for N64 ABI.
- [Low] Typo in `ustat` syscall entry causes linker errors for both N32 and N64 ABIs.
- [Low] Build fatally broken due to missing and deleted prerequisites in Makefile rules for generated headers.
--
commit dbd1eadaff2c006f6b57d84d5f841a630aa58232
Author: André Almeida <andrealmeid@igalia.com>
mips: Use the common syscall table
This patch migrates MIPS to use the common syscall table from number 403
onwards, taking advantage of the shared numbers across architectures. It
merges the N32 and N64 syscall tables into a single syscall_n.tbl file and
updates the Makefile rules for generation, maintaining functional parity for
the O32, N32, and N64 ABIs.
> diff --git a/arch/mips/kernel/syscalls/Makefile b/arch/mips/kernel/syscalls/Makefile
> index 1bfc2346d1009..aaa5443ea9068 100644
> --- a/arch/mips/kernel/syscalls/Makefile
> +++ b/arch/mips/kernel/syscalls/Makefile
[ ... ]
> quiet_cmd_sysnr = SYSNR $@
> cmd_sysnr = $(CONFIG_SHELL) $(sysnr) \
> --prefix $(sysnr_pfx_$(basetarget))_Linux_ $< $@
[Severity: Medium]
Should this command also include the --abis flag like cmd_syshdr does? Since
cmd_sysnr runs on the common table without filtering by ABI, it seems it
might extract the highest syscall number across all ABIs. If a 32-bit-only
syscall is added later, couldn't this make __NR_64_Linux_syscalls larger than
the actual generated N64 table?
A mismatch like this might allow an out-of-bounds read during the syscall
bounds check in scall64-n64.S. Also, because $(src_$*) is missing here, any
local syscalls wouldn't be counted either.
> quiet_cmd_systbl = SYSTBL $@
> - cmd_systbl = $(CONFIG_SHELL) $(systbl) $< $@
> + cmd_systbl = $(CONFIG_SHELL) $(systbl) \
> + --common-tbl $(systbl_common) \
> + --abis $(abis_$*) $(src_$*) $@
>
> $(uapi)/unistd_%.h: $(src)/syscall_%.tbl $(syshdr) FORCE
> $(call if_changed,syshdr)
[Severity: Low]
Does this rule need to be updated to use $(src_$*) instead of
$(src)/syscall_%.tbl? Since this patch deletes files like syscall_n32.tbl and
syscall_n64.tbl, Kbuild might fail with a "No rule to make target" error when
trying to build unistd_n32.h because it will still look for the deleted
tables.
[ ... ]
> -$(kapi)/syscall_table_%.h: $(src)/syscall_%.tbl $(systbl) FORCE
> +$(kapi)/syscall_table_%.h: $(systbl) $(systbl_common) FORCE
> $(call if_changed,systbl)
[Severity: Low]
Is it intentional to drop the local table variable $(src_$*) from the
prerequisites here? Without it, Kbuild might not trigger incremental rebuilds
if the local syscall table gets modified.
> diff --git a/arch/mips/kernel/syscalls/syscall_n.tbl b/arch/mips/kernel/syscalls/syscall_n.tbl
> new file mode 100644
> index 0000000000000..e3d278f715b7e
> --- /dev/null
> +++ b/arch/mips/kernel/syscalls/syscall_n.tbl
[ ... ]
> +124 common capset sys_capset
> +125 common rt_sigpending sys_rt_sigpending compat_sys_rt_sigpending
> +126 common rt_sigtimedwait sys_rt_sigtimedwait_time compat_sys_rt_sigtimedwait_time32
[Severity: Low]
Could there be a typo in the native entry point name here? The kernel function
is sys_rt_sigtimedwait, so sys_rt_sigtimedwait_time seems likely to cause an
unresolved symbol error when linking the N64 ABI.
> +127 common rt_sigqueueinfo sys_rt_sigqueueinfo compat_sys_rt_sigqueueinfo
> +128 common rt_sigsuspend sys_rt_sigsuspend compat_sys_rt_sigsuspend
> +129 common sigaltstack sys_sigaltstack compat_sys_sigaltstack
> +130 common utime sys_utime sys_utime32
> +131 common mknod sys_mknod
> +132 common personality sys_personality sys_32_personality
> +133 common ustat sys_usta compat_sys_usta
[Severity: Low]
Is it possible that the trailing 't' was accidentally truncated on these entry
points? Using sys_usta and compat_sys_usta instead of sys_ustat and
compat_sys_ustat will likely break the build with undefined references for
both N32 and N64 ABIs.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260828-tonyk-syscall_table-v6-0-fdd358456cf1@igalia.com?part=9
next prev parent reply other threads:[~2026-08-28 23:35 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 [this message]
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
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=20260828233523.D36BB1F000E9@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