--- //depot/projects/smpng/sys/alpha/linux/linux_machdep.c 2005/03/01 16:04:42 +++ //depot/user/jhb/proc/alpha/linux/linux_machdep.c 2005/10/05 15:50:44 @@ -81,7 +81,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/alpha/osf1/osf1_misc.c 2005/09/30 17:46:19 +++ //depot/user/jhb/proc/alpha/osf1/osf1_misc.c 2005/10/05 15:50:44 @@ -1246,7 +1246,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/amd64/linux32/linux32_machdep.c 2005/06/24 18:10:31 +++ //depot/user/jhb/proc/amd64/linux32/linux32_machdep.c 2005/10/05 15:50:44 @@ -205,7 +205,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/compat/freebsd32/freebsd32_misc.c 2005/10/27 19:51:50 +++ //depot/user/jhb/proc/compat/freebsd32/freebsd32_misc.c 2005/10/27 20:24:33 @@ -323,7 +323,6 @@ uap->argv, uap->envv); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/compat/svr4/svr4_misc.c 2005/10/24 20:39:54 +++ //depot/user/jhb/proc/compat/svr4/svr4_misc.c 2005/10/25 17:50:26 @@ -175,7 +175,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } @@ -195,7 +194,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/i386/ibcs2/ibcs2_misc.c 2005/07/07 19:45:15 +++ //depot/user/jhb/proc/i386/ibcs2/ibcs2_misc.c 2005/10/05 15:50:44 @@ -207,7 +207,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } @@ -227,7 +226,6 @@ free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/i386/linux/linux_machdep.c 2005/08/18 17:04:21 +++ //depot/user/jhb/proc/i386/linux/linux_machdep.c 2005/10/05 15:50:44 @@ -122,7 +122,6 @@ free(newpath, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); - exec_free_args(&eargs); return (error); } --- //depot/projects/smpng/sys/kern/kern_exec.c 2005/10/24 20:39:54 +++ //depot/user/jhb/proc/kern/kern_exec.c 2005/10/25 17:50:26 @@ -87,6 +87,7 @@ static int sysctl_kern_stackprot(SYSCTL_HANDLER_ARGS); static int do_execve(struct thread *td, struct image_args *args, struct mac *mac_p); +static void exec_free_args(struct image_args *); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD, @@ -182,12 +183,8 @@ error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); - if (error == 0) error = kern_execve(td, &args, NULL); - - exec_free_args(&args); - return (error); } @@ -219,12 +216,8 @@ error = exec_copyin_args(&args, uap->fname, UIO_USERSPACE, uap->argv, uap->envv); - if (error == 0) error = kern_execve(td, &args, uap->mac_p); - - exec_free_args(&args); - return (error); #else return (ENOSYS); @@ -785,19 +783,6 @@ p->p_flag &= ~P_INEXEC; PROC_UNLOCK(p); - if (imgp->vmspace_destroyed) { - /* sorry, no more process anymore. exit gracefully */ -#ifdef MAC - mac_execve_exit(imgp); - if (interplabel != NULL) - mac_vnode_label_free(interplabel); -#endif - VFS_UNLOCK_GIANT(vfslocked); - exec_free_args(args); - exit1(td, W_EXITCODE(0, SIGABRT)); - /* NOT REACHED */ - error = 0; - } done2: #ifdef MAC mac_execve_exit(imgp); @@ -805,6 +790,13 @@ mac_vnode_label_free(interplabel); #endif VFS_UNLOCK_GIANT(vfslocked); + exec_free_args(args); + + if (error && imgp->vmspace_destroyed) { + /* sorry, no more process anymore. exit gracefully */ + exit1(td, W_EXITCODE(0, SIGABRT)); + /* NOT REACHED */ + } return (error); } @@ -1048,7 +1040,7 @@ return (0); } -void +static void exec_free_args(struct image_args *args) { --- //depot/projects/smpng/sys/kern/kern_kse.c 2005/10/14 18:03:59 +++ //depot/user/jhb/proc/kern/kern_kse.c 2005/10/14 19:32:30 @@ -266,7 +266,6 @@ args.argv, args.envp); if (error == 0) error = kern_execve(td, &iargs, NULL); - exec_free_args(&iargs); if (error == 0) { PROC_LOCK(p); SIGSETOR(td->td_siglist, args.sigpend); --- //depot/projects/smpng/sys/sys/imgact.h 2005/03/01 16:04:42 +++ //depot/user/jhb/proc/sys/imgact.h 2005/10/05 15:50:44 @@ -76,7 +76,6 @@ int exec_shell_imgact(struct image_params *); int exec_copyin_args(struct image_args *, char *, enum uio_seg, char **, char **); -void exec_free_args(struct image_args *); #endif #endif /* !_SYS_IMGACT_H_ */