]> git.baikalelectronics.ru Git - kernel.git/commitdiff
m68k: Update ->thread.esp0 before calling syscall_trace() in ret_from_signal
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 25 Jul 2021 17:19:45 +0000 (17:19 +0000)
committerGeert Uytterhoeven <geert@linux-m68k.org>
Fri, 24 Sep 2021 11:35:01 +0000 (13:35 +0200)
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@zeniv.linux.org.uk>
Fixes: 54d5af1ea8bf ("m68k: Missing syscall_trace() on sigreturn")
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Tested-by: Michael Schmitz <schmitzmic@gmail.com>
Reviewed-by: Michael Schmitz <schmitzmic@gmail.com>
Tested-by: Finn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/YP2dMWeV1LkHiOpr@zeniv-ca.linux.org.uk
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
arch/m68k/kernel/entry.S

index 9dd76fbb7c6b2752b0a8eefb847a65e2f26251b1..ff9e842cec0fb835d42685207134c86e9c6ee109 100644 (file)
@@ -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