This is a note to let you know that I've just added the patch titled m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal to the 5.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: m68k-update-thread.esp0-before-calling-syscall_trace.patch and it can be found in the queue-5.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit d42a99f0adfb3f26c4bcc6c0c4a54837d07cfa66 Author: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Date: Sun Jul 25 17:19:45 2021 +0000 m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal [ 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... Fucked-up-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Fixes: bd6f56a75bb2 ("m68k: Missing syscall_trace() on sigreturn") Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Tested-by: Michael Schmitz <schmitzmic@xxxxxxxxx> Reviewed-by: Michael Schmitz <schmitzmic@xxxxxxxxx> Tested-by: Finn Thain <fthain@xxxxxxxxxxxxxx> Link: https://lore.kernel.org/r/YP2dMWeV1LkHiOpr@xxxxxxxxxxxxxxxxxxxxx Signed-off-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S index 9dd76fbb7c6b..ff9e842cec0f 100644 --- a/arch/m68k/kernel/entry.S +++ b/arch/m68k/kernel/entry.S @@ -186,6 +186,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