summaryrefslogtreecommitdiffstats
path: root/sys/alpha/linux
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-02-18 18:32:32 +0000
committerjhb <jhb@FreeBSD.org>2005-02-18 18:32:32 +0000
commitf3b0da87da68e835c46bf6b6850208f22f3de36f (patch)
tree2a14368a2eda10c312fae1ae4bcdf0d9abe4af0d /sys/alpha/linux
parentbae04706aeb81e31b15d2472626ff950be3e0392 (diff)
downloadFreeBSD-src-f3b0da87da68e835c46bf6b6850208f22f3de36f.zip
FreeBSD-src-f3b0da87da68e835c46bf6b6850208f22f3de36f.tar.gz
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@
Diffstat (limited to 'sys/alpha/linux')
-rw-r--r--sys/alpha/linux/linux_machdep.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/sys/alpha/linux/linux_machdep.c b/sys/alpha/linux/linux_machdep.c
index 7798fbf..b4cebb0 100644
--- a/sys/alpha/linux/linux_machdep.c
+++ b/sys/alpha/linux/linux_machdep.c
@@ -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);
}
/*
OpenPOWER on IntegriCloud