qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] Fix for execve syscall


From: Kirill A. Shutemov
Subject: [Qemu-devel] [PATCH] Fix for execve syscall
Date: Mon, 19 Nov 2007 15:39:01 +0200
User-agent: Mutt/1.5.16 (2007-06-09)

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: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]