[<prev] [next>] [day] [month] [year] [list]
Message-Id: <6f3e4ce6abf8b4b1f451f94ea2213a2977986bda.1727408466.git.fthain@linux-m68k.org>
Date: Fri, 27 Sep 2024 13:41:06 +1000
From: Finn Thain <fthain@...ux-m68k.org>
To: stable@...nel.org
Cc: Geert Uytterhoeven <geert@...ux-m68k.org>,
Al Viro <viro@...iv.linux.org.uk>,
linux-m68k@...ts.linux-m68k.org,
linux-kernel@...r.kernel.org
Subject: [PATCH] m68k: Update ->thread.esp0 before calling syscall_trace() in
ret_from_signal
From: Al Viro <viro@...iv.linux.org.uk>
[ Upstream commit 50e43a57334400668952f8e551c9d87d3ed2dfef ]
We get there when sigreturn has performed obscene acts on kernel stack;
in particular, the location of pt_regs has shifted. We are about to call
syscall_trace(), which might stop for tracer. If that happens, we'd better
have task_pt_regs() returning correct result...
Cc: stable@...nel.org # <= 5.14.y
Fucked-up-by: Al Viro <viro@...iv.linux.org.uk>
Fixes: bd6f56a75bb2 ("m68k: Missing syscall_trace() on sigreturn")
Signed-off-by: Al Viro <viro@...iv.linux.org.uk>
Tested-by: Michael Schmitz <schmitzmic@...il.com>
Reviewed-by: Michael Schmitz <schmitzmic@...il.com>
Tested-by: Finn Thain <fthain@...ux-m68k.org>
Link: https://lore.kernel.org/r/YP2dMWeV1LkHiOpr@zeniv-ca.linux.org.uk
Signed-off-by: Geert Uytterhoeven <geert@...ux-m68k.org>
Signed-off-by: Finn Thain <fthain@...ux-m68k.org>
---
arch/m68k/kernel/entry.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 417d8f0e8962..0d03b4f2077b 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -182,6 +182,8 @@ ENTRY(ret_from_signal)
movel %curptr@(TASK_STACK),%a1
tstb %a1@(TINFO_FLAGS+2)
jge 1f
+ lea %sp@(SWITCH_STACK_SIZE),%a1
+ movel %a1,%curptr@(TASK_THREAD+THREAD_ESP0)
jbsr syscall_trace
1: RESTORE_SWITCH_STACK
addql #4,%sp
--
2.39.5
Powered by blists - more mailing lists