]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sparc: Synchronize user stack on fork and clone
authorAndreas Larsson <andreas@gaisler.com>
Mon, 19 Jan 2026 14:47:52 +0000 (15:47 +0100)
committerAndreas Larsson <andreas@gaisler.com>
Fri, 6 Feb 2026 14:00:47 +0000 (15:00 +0100)
commite38eba3b77878ada327a572a41596a3b0b44e522
tree29132b84c6ea66001bec2763ad5871b014d09059
parentdc2f4d41a6b686dbd78a6346126cdc992f2de441
sparc: Synchronize user stack on fork and clone

Flush all uncommitted user windows before calling the generic syscall
handlers for clone, fork, and vfork.

Prior to entering the arch common handlers sparc_{clone|fork|vfork}, the
arch-specific syscall wrappers for these syscalls will attempt to flush
all windows (including user windows).

In the window overflow trap handlers on both SPARC{32|64},
if the window can't be stored (i.e due to MMU related faults) the routine
backups the user window and increments a thread counter (wsaved).

By adding a synchronization point after the flush attempt, when fault
handling is enabled, any uncommitted user windows will be flushed.

Link: https://sourceware.org/bugzilla/show_bug.cgi?id=31394
Closes: https://lore.kernel.org/sparclinux/fe5cc47167430007560501aabb28ba154985b661.camel@physik.fu-berlin.de/
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Ludwig Rydberg <ludwig.rydberg@gaisler.com>
Tested-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Link: https://lore.kernel.org/r/20260119144753.27945-2-ludwig.rydberg@gaisler.com
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
arch/sparc/kernel/process.c