Skip to content

Commit 2ca8a1d

Browse files
Michael Schmitzgeertu
authored andcommitted
m68k: Check syscall_trace_enter() return code
Check return code of syscall_trace_enter(), and skip syscall if -1. Return code will be left at what had been set by ptrace or seccomp (in regs->d0). No regression seen in testing with strace on ARAnyM. Signed-off-by: Michael Schmitz <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 65a1601 commit 2ca8a1d

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

arch/m68k/68000/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ do_trace:
4545
jbsr syscall_trace_enter
4646
RESTORE_SWITCH_STACK
4747
addql #4,%sp
48+
addql #1,%d0
49+
jeq ret_from_exception
4850
movel %sp@(PT_OFF_ORIG_D0),%d1
4951
movel #-ENOSYS,%d0
5052
cmpl #NR_syscalls,%d1

arch/m68k/coldfire/entry.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ ENTRY(system_call)
9090
jbsr syscall_trace_enter
9191
RESTORE_SWITCH_STACK
9292
addql #4,%sp
93+
addql #1,%d0
94+
jeq ret_from_exception
9395
movel %d3,%a0
9496
jbsr %a0@
9597
movel %d0,%sp@(PT_OFF_D0) /* save the return value */

arch/m68k/kernel/entry.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,12 @@ do_trace_entry:
184184
jbsr syscall_trace_enter
185185
RESTORE_SWITCH_STACK
186186
addql #4,%sp
187+
addql #1,%d0 | optimization for cmpil #-1,%d0
188+
jeq ret_from_syscall
187189
movel %sp@(PT_OFF_ORIG_D0),%d0
188190
cmpl #NR_syscalls,%d0
189191
jcs syscall
192+
jra ret_from_syscall
190193
badsys:
191194
movel #-ENOSYS,%sp@(PT_OFF_D0)
192195
jra ret_from_syscall

0 commit comments

Comments
 (0)