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>
This commit is contained in:
Mathias Krause 2017-02-07 19:47:16 +01:00 committed by Martin Roth
parent d42c38b93c
commit 901efea8ab
1 changed files with 1 additions and 1 deletions

View File

@ -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