qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix for execve syscall
@ 2007-11-19 13:39 Kirill A. Shutemov
  2007-11-30  5:38 ` Magnus Damm
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill A. Shutemov @ 2007-11-19 13:39 UTC (permalink / raw)
  To: qemu-devel

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

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

* Re: [Qemu-devel] [PATCH] Fix for execve syscall
  2007-11-19 13:39 [Qemu-devel] [PATCH] Fix for execve syscall Kirill A. Shutemov
@ 2007-11-30  5:38 ` Magnus Damm
  0 siblings, 0 replies; 2+ messages in thread
From: Magnus Damm @ 2007-11-30  5:38 UTC (permalink / raw)
  To: qemu-devel

On Nov 19, 2007 10:39 PM, Kirill A. Shutemov <k.shutemov@gmail.com> wrote:
> 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)".

Works here for the sh4 target. Unbreaks the execve syscall. Please apply.

/ magnus

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

end of thread, other threads:[~2007-11-30  5:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-19 13:39 [Qemu-devel] [PATCH] Fix for execve syscall Kirill A. Shutemov
2007-11-30  5:38 ` Magnus Damm

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