summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2017-02-07 19:47:16 +0100
committerMartin Roth <martinroth@google.com>2017-02-15 21:56:14 +0100
commit901efea8abbb3131685fd69fd4ad7c5093c8cb3c (patch)
treef3cfd3b71c8a3e216ba848e82172f64d17aa02a1
parentd42c38b93cbfd93426a7789af6a0e03479c692e8 (diff)
libpayload: x86/exec - fix return value passing
The pointer to write the return value to is in %ecx, not %eax. Writing to (%eax) leads to memory corruptions as %eax holds the return value, e.g. would write zero to address zero for a "successful" returning payload. Change-Id: I82df27ae89a9e3d25f479ebdda2b50ea57565459 Signed-off-by: Mathias Krause <minipli@googlemail.com> Reviewed-on: https://review.coreboot.org/18332 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--payloads/libpayload/arch/x86/exec.S2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/arch/x86/exec.S b/payloads/libpayload/arch/x86/exec.S
index c7595e979c..7d89cc00a5 100644
--- a/payloads/libpayload/arch/x86/exec.S
+++ b/payloads/libpayload/arch/x86/exec.S
@@ -85,7 +85,7 @@ i386_do_exec:
*/
movl 20(%ebp), %ecx
- movl %eax, (%eax)
+ movl %eax, (%ecx)
/* Get the rest of the saved registers */
popl %ecx