qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Magnus Damm" <magnus.damm@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] execve syscall fix
Date: Thu, 29 Nov 2007 22:42:23 +0900	[thread overview]
Message-ID: <aec7e5c30711290542w1794b2b8rb482cdc87ebb0a0b@mail.gmail.com> (raw)

[-- 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))

             reply	other threads:[~2007-11-29 13:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-29 13:42 Magnus Damm [this message]
2007-11-29 15:59 ` [Qemu-devel] [PATCH] execve syscall fix Kirill A. Shutemov
2007-11-29 16:00 ` Kirill A. Shutemov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aec7e5c30711290542w1794b2b8rb482cdc87ebb0a0b@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).