From 8b2b61e0001281be0dcd3dedc899bf187172fecb Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Wed, 15 Aug 2018 20:46:18 +0300 Subject: mips archs: fix runaway execution if start fn passed to clone returns Call SYS_exit on return from fn in __clone. This is the expected behavior of this function. Without this the child task will crash on return from fn, since it will return to nowhere. --- src/thread/mips/clone.s | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/thread/mips/clone.s') diff --git a/src/thread/mips/clone.s b/src/thread/mips/clone.s index 37dddf57..30a0146b 100644 --- a/src/thread/mips/clone.s +++ b/src/thread/mips/clone.s @@ -28,5 +28,8 @@ __clone: nop 1: lw $25, 0($sp) lw $4, 4($sp) - jr $25 + jalr $25 nop + move $4, $2 + li $2, 4001 + syscall -- cgit v1.2.1