qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Kirill A. Shutemov" <k.shutemov@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] Fix for execve syscall
Date: Mon, 19 Nov 2007 15:39:01 +0200	[thread overview]
Message-ID: <20071119133901.GA27579@localhost.localdomain> (raw)

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

There is error in execve syscall implementation. guest_argp and guest_envp
should not be altered during argument list checking. 

This bug was introduced by commit "suppressed tgetx and tputx (initial 
patch by Thayne Harbaugh)".

diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f08baf9..0918124 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -3266,18 +3266,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
             argc = 0;
             guest_argp = arg2;
             for (gp = guest_argp; ; gp++) {
-                if (get_user_ual(guest_argp, gp))
+                if (get_user_ual(addr, gp))
                     goto efault;
-                if (!guest_argp)
+                if (!addr)
                     break;
                 argc++;
             }
             envc = 0;
             guest_envp = arg3;
             for (gp = guest_envp; ; gp++) {
-                if (get_user_ual(guest_envp, gp))
+                if (get_user_ual(addr, gp))
                     goto efault;
-                if (!guest_envp)
+                if (!addr)
                     break;
                 envc++;
             }
-- 
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + Velesys LLC, http://www.velesys.com/
 + ALT Linux Team, http://www.altlinux.com/

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

             reply	other threads:[~2007-11-19 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-19 13:39 Kirill A. Shutemov [this message]
2007-11-30  5:38 ` [Qemu-devel] [PATCH] Fix for execve syscall Magnus Damm

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=20071119133901.GA27579@localhost.localdomain \
    --to=k.shutemov@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).