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)
This commit is contained in:
parent
21ce09ca81
commit
de1c01ad37
@ -113,7 +113,8 @@ linux_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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user