]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
arm: get rid of execve wrapper, switch to generic execve() implementation
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 Aug 2012 07:52:41 +0000 (11:52 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 6 Sep 2012 17:57:23 +0000 (13:57 -0400)
said implementation lives in fs/exec.c now; conditional on
__ARCH_WANT_SYS_EXECVE

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/arm/include/asm/unistd.h
arch/arm/kernel/calls.S
arch/arm/kernel/entry-common.S
arch/arm/kernel/sys_arm.c
fs/exec.c

index 2c9b7a87e64b1597f4a568b4f2429714360dae27..6a70aa42debb1ab738eef726c98f84ad7c0c72ab 100644 (file)
 #define __ARCH_WANT_OLD_READDIR
 #define __ARCH_WANT_SYS_SOCKETCALL
 #endif
+#define __ARCH_WANT_SYS_EXECVE
 #define __ARCH_WANT_KERNEL_EXECVE
 
 /*
index 463ff4a0ec8acaa69372b8abd40a39260ee91736..b287b3580a9f8b9d902aba2f2595eddbed57bace 100644 (file)
@@ -20,7 +20,7 @@
                CALL(sys_creat)
                CALL(sys_link)
 /* 10 */       CALL(sys_unlink)
-               CALL(sys_execve_wrapper)
+               CALL(sys_execve)
                CALL(sys_chdir)
                CALL(OBSOLETE(sys_time))        /* used by libc4 */
                CALL(sys_mknod)
index 08c682af5e52e290257f0675ea9c8a8762b55b6f..6ac22d69061eefc6daf1ced7731a638746515a2a 100644 (file)
@@ -524,11 +524,6 @@ sys_vfork_wrapper:
                b       sys_vfork
 ENDPROC(sys_vfork_wrapper)
 
-sys_execve_wrapper:
-               add     r3, sp, #S_OFF
-               b       sys_execve
-ENDPROC(sys_execve_wrapper)
-
 sys_clone_wrapper:
                add     ip, sp, #S_OFF
                str     ip, [sp, #4]
index c8e729efc1872cc3c5921334bca3531f9a68b7b6..c2a898aa57aada4b16cff08ea6da84d797f88ab9 100644 (file)
@@ -59,26 +59,6 @@ asmlinkage int sys_vfork(struct pt_regs *regs)
        return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs->ARM_sp, regs, 0, NULL, NULL);
 }
 
-/* sys_execve() executes a new program.
- * This is called indirectly via a small wrapper
- */
-asmlinkage int sys_execve(const char __user *filenamei,
-                         const char __user *const __user *argv,
-                         const char __user *const __user *envp, struct pt_regs *regs)
-{
-       int error;
-       char * filename;
-
-       filename = getname(filenamei);
-       error = PTR_ERR(filename);
-       if (IS_ERR(filename))
-               goto out;
-       error = do_execve(filename, argv, envp, regs);
-       putname(filename);
-out:
-       return error;
-}
-
 /*
  * Since loff_t is a 64 bit type we avoid a lot of ABI hassle
  * with a different argument ordering.
index 85652ce1ecfe6e7d5624efc466bdb6767c72e9a3..e89039d90e1362288fa7301dd4aed0a5ebea9adf 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -2319,6 +2319,22 @@ int dump_seek(struct file *file, loff_t off)
 }
 EXPORT_SYMBOL(dump_seek);
 
+#ifdef __ARCH_WANT_SYS_EXECVE
+SYSCALL_DEFINE3(execve,
+               const char __user *, filename,
+               const char __user *const __user *, argv,
+               const char __user *const __user *, envp)
+{
+       const char *path = getname(filename);
+       int error = PTR_ERR(path);
+       if (!IS_ERR(path)) {
+               error = do_execve(path, argv, envp, current_pt_regs());
+               putname(path);
+       }
+       return error;
+}
+#endif
+
 #ifdef __ARCH_WANT_KERNEL_EXECVE
 int kernel_execve(const char *filename,
                  const char *const argv[],