Skip to contentSkip to conversation

Fix for execve syscall

PATCH In review Kirill A. Shutemov 2 participants 2 messages Nov 19, 2007 – Nov 30, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for execve syscall

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

linux-user/syscall.c +4 -4
index f08baf9..0918124 100644
@@ -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++;
             }
Signature · 4 lines
Regards,  Kirill A. Shutemov
 + Belarus, Minsk
 + Velesys LLC, http://www.velesys.com/
 + ALT Linux Team, http://www.altlinux.com/
#1 lore raw
Quoted 5 lines · Kirill A. Shutemov

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