diff --git a/UPDATING b/UPDATING index e054fe4737ae..d7bf823252f5 100644 --- a/UPDATING +++ b/UPDATING @@ -21,6 +21,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 6.x IS SLOW: developers choose to disable these features on build machines to maximize performance. +20050223: + The layout of struct image_params has changed. You have to + recompile all compatibility modules (linux, svr4, etc) for use + with the new kernel. + 20050223: The p4tcc driver has been merged into cpufreq(4). This makes "options CPU_ENABLE_TCC" obsolete. Please load cpufreq.ko or diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c index 98b52eaa9a17..7a15f754b374 100644 --- a/sys/kern/kern_exec.c +++ b/sys/kern/kern_exec.c @@ -320,7 +320,7 @@ do_execve(td, args, mac_p) imgp->entry_addr = 0; imgp->vmspace_destroyed = 0; imgp->interpreted = 0; - imgp->interpreter_name[0] = '\0'; + imgp->interpreter_name = args->buf + PATH_MAX + ARG_MAX; imgp->auxargs = NULL; imgp->vp = NULL; imgp->object = NULL; @@ -931,9 +931,13 @@ exec_copyin_args(struct image_args *args, char *fname, return (EFAULT); /* * Allocate temporary demand zeroed space for argument and - * environment strings + * environment strings: + * + * o ARG_MAX for argument and environment; + * o MAXSHELLCMDLEN for the name of interpreters. */ - 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; @@ -997,8 +1001,8 @@ exec_free_args(struct image_args *args) { if (args->buf) { - kmem_free_wakeup(exec_map, - (vm_offset_t)args->buf, PATH_MAX + ARG_MAX); + kmem_free_wakeup(exec_map, (vm_offset_t)args->buf, + PATH_MAX + ARG_MAX + MAXSHELLCMDLEN); args->buf = NULL; } } diff --git a/sys/sys/imgact.h b/sys/sys/imgact.h index df79dfbd29ca..b1d0f0d09973 100644 --- a/sys/sys/imgact.h +++ b/sys/sys/imgact.h @@ -34,7 +34,7 @@ #include -#define MAXSHELLCMDLEN 128 +#define MAXSHELLCMDLEN PAGE_SIZE struct image_args { char *buf; /* pointer to string buffer */ @@ -57,7 +57,7 @@ struct image_params { unsigned long entry_addr; /* entry address of target executable */ char vmspace_destroyed; /* flag - we've blown away original vm space */ char interpreted; /* flag - this executable is interpreted */ - char interpreter_name[MAXSHELLCMDLEN]; /* name of the interpreter */ + char *interpreter_name; /* name of the interpreter */ void *auxargs; /* ELF Auxinfo structure pointer */ struct sf_buf *firstpage; /* first page that we mapped */ unsigned long ps_strings; /* PS_STRINGS for BSD/OS binaries */