From: sashiko-bot@kernel.org
To: "Jarkko Sakkinen" <jarkko@kernel.org>
Cc: linux-mm@kvack.org, linux-security-module@vger.kernel.org,
"Alexander Viro" <viro@zeniv.linux.org.uk>,
"Andrew Morton" <akpm@linux-foundation.org>,
"Ben Segall" <bsegall@google.com>,
"Christian Brauner" <brauner@kernel.org>,
"David Hildenbrand" <david@kernel.org>,
"David Howells" <dhowells@redhat.com>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"Dietmar Eggemann" <dietmar.eggemann@arm.com>,
"Ingo Molnar" <mingo@redhat.com>, "Jan Kara" <jack@suse.cz>,
"Jonathan Corbet" <corbet@lwn.net>,
"Juri Lelli" <juri.lelli@redhat.com>,
"Kees Cook" <kees@kernel.org>,
"K Prateek Nayak" <kprateek.nayak@amd.com>,
"Liam R. Howlett" <liam@infradead.org>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Manfred Spraul" <manfred@colorfullife.com>,
"Mel Gorman" <mgorman@suse.de>, "Michal Hocko" <mhocko@suse.com>,
"Mike Rapoport" <rppt@kernel.org>, "Neal Gompa" <neal@gompa.dev>,
"Paul Moore" <paul@paul-moore.com>,
"Pavel Tikhomirov" <ptikhomirov@virtuozzo.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
"Serge Hallyn" <sergeh@kernel.org>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
"Suren Baghdasaryan" <surenb@google.com>,
"Valentin Schneider" <vschneid@redhat.com>,
"Vincent Guittot" <vincent.guittot@linaro.org>,
"Vlastimil Babka" <vbabka@kernel.org>
Subject: Re: [RFC PATCH 10/13] arch: Wire up rootns system calls
Date: Wed, 18 Nov 2026 05:09:56 +0000 [thread overview]
Message-ID: <sashiko-outbox-220145@kernel.org> (raw)
In-Reply-To: <20261117050841.3289652-11-jarkko@kernel.org>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] arch: missing fork wrappers and copy_thread() handling for
rootns_enter()
- [Medium] powerpc: syscalls: mark rootns syscalls as nospu instead of
common
--
commit 6e1db5e1442ac6454b78c4391c7f17751ffafb5b
Author: Jarkko Sakkinen <jarkko@kernel.org>
arch: Wire up rootns system calls
This commit wires up the rootns_create(), rootns_wait(), rootns_kill(), and
rootns_enter() system calls across the architecture syscall tables and
asm-generic/unistd.h.
> diff --git a/arch/alpha/kernel/syscalls/syscall.tbl b/arch/alpha/kernel/syscalls/syscall.tbl
> index 52e3538cc7df4..a945b15abe6dd 100644
> --- a/arch/alpha/kernel/syscalls/syscall.tbl
> +++ b/arch/alpha/kernel/syscalls/syscall.tbl
> @@ -512,3 +512,7 @@
> 580 common listns sys_listns
> 581 common rseq_slice_yield sys_rseq_slice_yield
> 582 common fchroot sys_fchroot
> +583 common rootns_create sys_rootns_create
> +584 common rootns_wait sys_rootns_wait
> +585 common rootns_kill sys_rootns_kill
> +586 common rootns_enter sys_rootns_enter
[Severity: High]
Does wiring rootns_enter directly to sys_rootns_enter corrupt the child
process's user registers and leak kernel stack contents on architectures that
require a fork-like entry wrapper?
sys_rootns_enter() calls kernel_clone() -> copy_process() -> copy_thread().
On Alpha, normal syscall entry (entSys) pops struct switch_stack before
calling the C handler, whereas fork, vfork, clone, and clone3 use fork_like
wrappers (alpha_clone3, etc.) to push struct switch_stack and call
__save_fpu(). Without that wrapper, copy_thread() copies
((struct switch_stack *)regs) - 1, which holds sys_rootns_enter()'s C stack
frame, into childstack and restores kernel stack words into the child's
r9-r15 registers in ret_from_fork.
The same issue affects the other architectures in this patch whose normal
syscall entry does not save callee-saved registers or register windows before
copy_thread():
- m68k needs a SAVE_SWITCH_STACK wrapper like __sys_clone3 so copy_thread()
does not populate the child's switch_stack (d6-d7, a3-a6) from the C frame.
- MIPS (o32, n32, n64) needs save_static_function() so s0-s8 are saved into
struct pt_regs before copy_thread().
- PA-RISC needs a fork_like wrapper like sys_clone3_wrapper to save r3-r18
and cr27 into task->thread.regs.
- SPARC (32-bit and 64-bit) needs an assembly wrapper like __sys_clone3 /
sparc_clone3 to flush register windows and call synchronize_user_stack(),
and copy_thread() in process_32.c and process_64.c needs to check for
__NR_rootns_enter alongside __NR_clone3 so it does not apply SunOS fork()
return conventions (which set the child's %o0 to current->pid instead of 0
and clobber %o1).
- ARC, Nios II, and OpenRISC (via include/uapi/asm-generic/unistd.h and
scripts/syscall.tbl) likewise require their callee-saved register /
switch_stack wrappers before calling sys_rootns_enter().
[ ... ]
> diff --git a/arch/powerpc/kernel/syscalls/syscall.tbl b/arch/powerpc/kernel/syscalls/syscall.tbl
> index cfbb70039ff00..610ceedd1a14c 100644
> --- a/arch/powerpc/kernel/syscalls/syscall.tbl
> +++ b/arch/powerpc/kernel/syscalls/syscall.tbl
> @@ -563,3 +563,7 @@
> 470 common listns sys_listns
> 471 nospu rseq_slice_yield sys_rseq_slice_yield
> 472 common fchroot sys_fchroot
> +473 common rootns_create sys_rootns_create
> +474 common rootns_wait sys_rootns_wait compat_sys_rootns_wait
> +475 common rootns_kill sys_rootns_kill
> +476 common rootns_enter sys_rootns_enter
[Severity: Medium]
Should the rootns syscalls, especially rootns_enter, be marked nospu instead
of common on PowerPC?
Entries marked common are included in spu_syscall_table[] and can be invoked
by a Cell SPU program via spu_process_callback() -> spu_sys_callback() while
the host PowerPC thread is inside spufs_run_spu(). Process creation and wait
syscalls (fork, vfork, clone, clone3, waitid) are marked nospu so an SPU
context cannot clone the host PPE thread from inside sys_spu_run().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261117050841.3289652-1-jarkko@kernel.org?part=10
next prev parent reply other threads:[~2026-11-18 5:09 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-17 5:08 [RFC PATCH 00/13] Namespace for namespace roots Jarkko Sakkinen
2026-11-17 5:08 ` [RFC PATCH 01/13] nsproxy: Pass nsproxy to create_new_namespaces() Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 02/13] rootns: Add core infrastructure for root namespaces Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 03/13] rootns: Track init lifecycle via copy_process() and pid_namespace Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 04/13] rootns: Add rootns_create() system call Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 05/13] rootns: Add rootns_wait() " Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 06/13] rootns: Add rootns_kill() " Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 07/13] rootns: Add rootns_enter() " Jarkko Sakkinen
2026-11-17 17:42 ` Andy Lutomirski
2026-11-17 20:03 ` Jarkko Sakkinen
2026-11-17 20:53 ` Andy Lutomirski
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 08/13] fs: Support FSCONFIG_SET_ROOTNS in fsconfig() Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 09/13] fs: Support installing rootns mount trees via move_mount() Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 10/13] arch: Wire up rootns system calls Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot [this message]
2026-11-17 5:08 ` [RFC PATCH 11/13] docs: Document root namespace uAPI Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 12/13] selftests/rootns: Add root namespace test suite Jarkko Sakkinen
2026-11-18 5:09 ` sashiko-bot
2026-11-17 5:08 ` [RFC PATCH 13/13] MAINTAINERS: Add entry for ROOT NAMESPACE Jarkko Sakkinen
2026-11-17 11:10 ` [RFC PATCH 00/13] Namespace for namespace roots Jarkko Sakkinen
2026-11-17 17:44 ` Andy Lutomirski
2026-11-17 18:48 ` Jarkko Sakkinen
2026-11-17 19:10 ` Jarkko Sakkinen
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-220145@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=bsegall@google.com \
--cc=corbet@lwn.net \
--cc=dave@stgolabs.net \
--cc=david@kernel.org \
--cc=dhowells@redhat.com \
--cc=dietmar.eggemann@arm.com \
--cc=jack@suse.cz \
--cc=jarkko@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=kees@kernel.org \
--cc=kprateek.nayak@amd.com \
--cc=liam@infradead.org \
--cc=linux-mm@kvack.org \
--cc=linux-security-module@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=manfred@colorfullife.com \
--cc=mgorman@suse.de \
--cc=mhocko@suse.com \
--cc=mingo@redhat.com \
--cc=neal@gompa.dev \
--cc=paul@paul-moore.com \
--cc=peterz@infradead.org \
--cc=ptikhomirov@virtuozzo.com \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=rppt@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=sergeh@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=viro@zeniv.linux.org.uk \
--cc=vschneid@redhat.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