qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] execve syscall fix
@ 2007-11-29 13:42 Magnus Damm
  2007-11-29 15:59 ` Kirill A. Shutemov
  2007-11-29 16:00 ` Kirill A. Shutemov
  0 siblings, 2 replies; 3+ messages in thread
From: Magnus Damm @ 2007-11-29 13:42 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 373 bytes --]

Hi everyone,

The execve syscall currently fails on sh4 with -EFAULT. I tracked it
down to what looks like a generic problem. This patch makes sure that
the two variables "guest_argp" and "guest_envp" are set to "arg2" and
"arg3" instead of the old NULL values from previous get_user_ual()
calls.

Execve now works as expected on sh4 with this fix. Please apply.

/ magnus

[-- Attachment #2: qemu-cvs-20071129-execve-fix.patch --]
[-- Type: application/octet-stream, Size: 729 bytes --]

--- 0001/linux-user/syscall.c
+++ work/linux-user/syscall.c	2007-11-29 22:32:45.000000000 +0900
@@ -3206,6 +3206,7 @@ abi_long do_syscall(void *cpu_env, int n
             argp = alloca((argc + 1) * sizeof(void *));
             envp = alloca((envc + 1) * sizeof(void *));
 
+            guest_argp = arg2;
             for (gp = guest_argp, q = argp; ;
                   gp += sizeof(abi_ulong), q++) {
                 if (get_user_ual(addr, gp))
@@ -3217,6 +3218,7 @@ abi_long do_syscall(void *cpu_env, int n
             }
             *q = NULL;
 
+            guest_envp = arg3;
             for (gp = guest_envp, q = envp; ;
                   gp += sizeof(abi_ulong), q++) {
                 if (get_user_ual(addr, gp))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-11-29 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-29 13:42 [Qemu-devel] [PATCH] execve syscall fix Magnus Damm
2007-11-29 15:59 ` Kirill A. Shutemov
2007-11-29 16:00 ` Kirill A. Shutemov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).