summaryrefslogtreecommitdiff
path: root/arch/m68k/kernel/entry.S
diff options
context:
space:
mode:
authorMichael Schmitz <schmitzmic@gmail.com>2023-01-12 16:55:27 +1300
committerGeert Uytterhoeven <geert@linux-m68k.org>2023-01-30 16:40:15 +0100
commit2ca8a1de4437f21562e57f9ac123914747a8e7a1 (patch)
tree77a39d4d3d30e6bb302482738321329cd972b290 /arch/m68k/kernel/entry.S
parent65a1601609e542e2f392213b121146762edfc19d (diff)
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 <schmitzmic@gmail.com> Reviewed-by: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20230112035529.13521-2-schmitzmic@gmail.com Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k/kernel/entry.S')
-rw-r--r--arch/m68k/kernel/entry.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/m68k/kernel/entry.S b/arch/m68k/kernel/entry.S
index 18f278bdbd21..42879e6eb651 100644
--- a/arch/m68k/kernel/entry.S
+++ b/arch/m68k/kernel/entry.S
@@ -184,9 +184,12 @@ do_trace_entry:
jbsr syscall_trace_enter
RESTORE_SWITCH_STACK
addql #4,%sp
+ addql #1,%d0 | optimization for cmpil #-1,%d0
+ jeq ret_from_syscall
movel %sp@(PT_OFF_ORIG_D0),%d0
cmpl #NR_syscalls,%d0
jcs syscall
+ jra ret_from_syscall
badsys:
movel #-ENOSYS,%sp@(PT_OFF_D0)
jra ret_from_syscall