From dafc349f8f598833a09bbccb6232164ba56d718a Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Wed, 3 Jun 2015 21:56:18 +0200 Subject: [PATCH] execve: Use ugets for copying argument 0 to udata 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 --- Kernel/syscall_exec16.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/syscall_exec16.c b/Kernel/syscall_exec16.c index a1d42ad0..6575c154 100644 --- a/Kernel/syscall_exec16.c +++ b/Kernel/syscall_exec16.c @@ -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); -- 2.34.1