diff options
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r-- | sys/compat/linux/linux_misc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 7ea4b8481220..225187826677 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/imgact_aout.h> #endif #include <sys/jail.h> +#include <sys/imgact.h> #include <sys/kernel.h> #include <sys/limits.h> #include <sys/lock.h> @@ -74,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include <sys/cpuset.h> #include <sys/uio.h> +#include <security/audit/audit.h> #include <security/mac/mac_framework.h> #include <vm/vm.h> @@ -2906,3 +2908,29 @@ linux_seccomp(struct thread *td, struct linux_seccomp_args *args) return (EINVAL); } } + +#ifndef COMPAT_LINUX32 +int +linux_execve(struct thread *td, struct linux_execve_args *args) +{ + struct image_args eargs; + char *path; + int error; + + LINUX_CTR(execve); + + if (!LUSECONVPATH(td)) { + error = exec_copyin_args(&eargs, args->path, UIO_USERSPACE, + args->argp, args->envp); + } else { + LCONVPATHEXIST(args->path, &path); + error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, args->argp, + args->envp); + LFREEPATH(path); + } + if (error == 0) + error = linux_common_execve(td, &eargs); + AUDIT_SYSCALL_EXIT(error == EJUSTRETURN ? 0 : error, td); + return (error); +} +#endif |