2007-09-19 14:26:43

by Andrey Mirkin

[permalink] [raw]
Subject: [PATCH] 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.

Signed-off-by: Andrey Mirkin <[email protected]>

-----

diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 1d232e5..ac6400e 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -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)


2007-09-19 16:18:20

by Andi Kleen

[permalink] [raw]
Subject: Re: [PATCH] return correct error code from child_rip in x86_64 entry.S

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