Skip to contentSkip to conversation

return correct error code from child_rip in x86_64 entry.S

PATCH In review Andrey Mirkin 2 participants 2 messages Sep 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 return correct error code from child_rip in x86_64 entry.S

From: Andrey Mirkin <[email protected]>

Right now register edi is just cleared before calling do_exit. That is wrong because correct return value will be ignored. Value from rax should be copied to rdi instead of clearing edi.

-----

arch/x86_64/kernel/entry.S +1 -1
index 1d232e5..ac6400e 100644
@@ -989,7 +989,7 @@ child_rip:
 	movq %rsi, %rdi
 	call *%rax
 	# exit
-	xorl %edi, %edi
+	movq %rax, %rdi
 	call do_exit
 	CFI_ENDPROC
 ENDPROC(child_rip)
#1 lore raw
Quoted 5 lines · On Wednesday 19 September 2007 16:26:25 Andrey Mirkin wrote:

From: Andrey Mirkin <[email protected]>

Right now register edi is just cleared before calling do_exit. That is wrong because correct return value will be ignored. Value from rax should be copied to rdi instead of clearing edi.

Applied thanks

-Andi