diff options
author | kib <kib@FreeBSD.org> | 2015-05-24 07:32:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-05-24 07:32:02 +0000 |
commit | 0d8ee7566b4bab2d197db6ce3ad8e5f4667ab319 (patch) | |
tree | 10a359f89eb0d5ea4f3d3643fb851c21a9bba508 /sys/i386/ibcs2 | |
parent | b7a860bb3a919e24d54388f1a29bff11e93832e0 (diff) | |
download | FreeBSD-src-0d8ee7566b4bab2d197db6ce3ad8e5f4667ab319.zip FreeBSD-src-0d8ee7566b4bab2d197db6ce3ad8e5f4667ab319.tar.gz |
MFC r282708:
On exec, single-threading must be enforced before arguments space is
allocated from exec_map.
Diffstat (limited to 'sys/i386/ibcs2')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_misc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/i386/ibcs2/ibcs2_misc.c b/sys/i386/ibcs2/ibcs2_misc.c index 0eeb6de..2701471 100644 --- a/sys/i386/ibcs2/ibcs2_misc.c +++ b/sys/i386/ibcs2/ibcs2_misc.c @@ -200,15 +200,22 @@ ibcs2_execv(td, uap) struct ibcs2_execv_args *uap; { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; CHECKALTEXIST(td, uap->path, &path); + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, NULL); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } @@ -218,16 +225,23 @@ ibcs2_execve(td, uap) struct ibcs2_execve_args *uap; { struct image_args eargs; + struct vmspace *oldvmspace; char *path; int error; CHECKALTEXIST(td, uap->path, &path); + error = pre_execve(td, &oldvmspace); + if (error != 0) { + free(path, M_TEMP); + return (error); + } error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, uap->envp); free(path, M_TEMP); if (error == 0) error = kern_execve(td, &eargs, NULL); + post_execve(td, error, oldvmspace); return (error); } |