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