execve: Use ugets for copying argument 0 to udata
authorTormod Volden <debian.tormod@gmail.com>
Wed, 3 Jun 2015 19:56:18 +0000 (21:56 +0200)
committerAlan Cox <alan@linux.intel.com>
Wed, 3 Jun 2015 21:26:46 +0000 (22:26 +0100)
The argument list gets squeezed in at the process memory top,
and if it is short, copying all 8 bytes might read above top.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Kernel/syscall_exec16.c

index a1d42ad..6575c15 100644 (file)
@@ -210,7 +210,7 @@ arg_t _execve(void)
        nenvp = wargs((char *) (nargv), ebuf, NULL);
 
        // Fill in udata.u_name with Program invocation name
-       uget((void *) ugetw(nargv), udata.u_name, 8);
+       ugets((void *) ugetw(nargv), udata.u_name, 8);
        memcpy(udata.u_ptab->p_name, udata.u_name, 8);
 
        brelse(abuf);