Use LCONVPATHEXIST() rather than CHECKALTEXIST() and use

exec_copyin_args(), kern_execve(), and exec_free_args() rather than
execve() to eliminate stackgap use from Alpha's linux_execve().

Silence on:	alpha@
This commit is contained in:
John Baldwin 2005-02-18 18:32:32 +00:00
parent 2daa7a07ae
commit f4b3589bdb

View File

@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/imgact.h>
#include <sys/lock.h> #include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/mutex.h> #include <sys/mutex.h>
@ -64,20 +66,23 @@ struct linux_select_argv {
int int
linux_execve(struct thread *td, struct linux_execve_args *args) linux_execve(struct thread *td, struct linux_execve_args *args)
{ {
struct execve_args bsd; struct image_args eargs;
caddr_t sg; char *path;
int error;
sg = stackgap_init(); LCONVPATHEXIST(td, args->path, &path);
CHECKALTEXIST(td, &sg, args->path);
#ifdef DEBUG #ifdef DEBUG
if (ldebug(execve)) if (ldebug(execve))
printf(ARGS(execve, "%s"), args->path); printf(ARGS(execve, "%s"), path);
#endif #endif
bsd.fname = args->path; error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp,
bsd.argv = args->argp; args->envp);
bsd.envv = args->envp; free(path, M_TEMP);
return (execve(td, &bsd)); if (error == 0)
error = kern_execve(td, &eargs, NULL);
exec_free_args(&eargs);
return (error);
} }
/* /*