diff options
author | jhb <jhb@FreeBSD.org> | 2005-06-24 17:41:28 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-06-24 17:41:28 +0000 |
commit | 0a8b4194dc9bd96f74d83e1051d82e94d1815a80 (patch) | |
tree | 59b772f10a234fb0e5721fb72fe72c64f067a2d3 /sys/compat | |
parent | dacb5026fc879768faef2ca5e6ddf1f16de40dd9 (diff) | |
download | FreeBSD-src-0a8b4194dc9bd96f74d83e1051d82e94d1815a80.zip FreeBSD-src-0a8b4194dc9bd96f74d83e1051d82e94d1815a80.tar.gz |
Correct the amount of data to allocate in these local copies of
exec_copyin_strings() to catch up to rev 1.266 of kern_exec.c. This fixes
panics on amd64 with compat binaries since exec_free_args() was freeing
more memory than these functions were allocating and the mismatch could
cause memory to be freed out from under other concurrent execs.
Approved by: re (scottl)
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/freebsd32/freebsd32_misc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c index ae61fbd..940da4e 100644 --- a/sys/compat/freebsd32/freebsd32_misc.c +++ b/sys/compat/freebsd32/freebsd32_misc.c @@ -237,7 +237,8 @@ freebsd32_exec_copyin_args(struct image_args *args, char *fname, * Allocate temporary demand zeroed space for argument and * environment strings */ - args->buf = (char *) kmem_alloc_wait(exec_map, PATH_MAX + ARG_MAX); + args->buf = (char *) kmem_alloc_wait(exec_map, + PATH_MAX + ARG_MAX + MAXSHELLCMDLEN); if (args->buf == NULL) return (ENOMEM); args->begin_argv = args->buf; |