Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180815174620.10752-3-segev208@gmail.com>
Date: Wed, 15 Aug 2018 20:46:19 +0300
From: Segev Finer <segev208@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH 2/3] mips64: Call 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/mips64/clone.s | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/thread/mips64/clone.s b/src/thread/mips64/clone.s
index 229d2677..1b71e07c 100644
--- a/src/thread/mips64/clone.s
+++ b/src/thread/mips64/clone.s
@@ -26,5 +26,8 @@ __clone:
 	nop
 1:	ld	$25, 0($sp)	# function pointer
 	ld	$4, 8($sp)	# argument pointer
-	jr	$25		# call the user's function
+	jalr	$25		# call the user's function
 	nop
+	move 	$4, $2
+	li	$2, 5058
+	syscall
-- 
2.18.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.