diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2012-09-10 11:11:46 -0400 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2012-10-17 09:41:51 -0400 |
commit | 6a872777ffff6184f4ac10bd71d926d5e6f2491e (patch) | |
tree | 81d85fc98bda389e61481d4963f2af554b1a0ffe /arch/arm64 | |
parent | 59dc67b0cc35cd93c3f4869fdd0d6cfb2a26ecbc (diff) |
arm64: Use generic sys_execve() implementation
This patch converts the arm64 port to use the generic sys_execve()
implementation removing the arm64-specific (compat_)sys_execve_wrapper()
functions.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64')
-rw-r--r-- | arch/arm64/include/asm/syscalls.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/unistd.h | 1 | ||||
-rw-r--r-- | arch/arm64/include/asm/unistd32.h | 2 | ||||
-rw-r--r-- | arch/arm64/kernel/entry.S | 5 | ||||
-rw-r--r-- | arch/arm64/kernel/sys.c | 22 | ||||
-rw-r--r-- | arch/arm64/kernel/sys32.S | 5 | ||||
-rw-r--r-- | arch/arm64/kernel/sys_compat.c | 18 |
7 files changed, 2 insertions, 54 deletions
diff --git a/arch/arm64/include/asm/syscalls.h b/arch/arm64/include/asm/syscalls.h index 09ff33572aab..81680a0ae913 100644 --- a/arch/arm64/include/asm/syscalls.h +++ b/arch/arm64/include/asm/syscalls.h | |||
@@ -23,9 +23,6 @@ | |||
23 | /* | 23 | /* |
24 | * System call wrappers implemented in kernel/entry.S. | 24 | * System call wrappers implemented in kernel/entry.S. |
25 | */ | 25 | */ |
26 | asmlinkage long sys_execve_wrapper(const char __user *filename, | ||
27 | const char __user *const __user *argv, | ||
28 | const char __user *const __user *envp); | ||
29 | asmlinkage long sys_clone_wrapper(unsigned long clone_flags, | 26 | asmlinkage long sys_clone_wrapper(unsigned long clone_flags, |
30 | unsigned long newsp, | 27 | unsigned long newsp, |
31 | void __user *parent_tid, | 28 | void __user *parent_tid, |
diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h index 63f853f8b718..b40dc6b69848 100644 --- a/arch/arm64/include/asm/unistd.h +++ b/arch/arm64/include/asm/unistd.h | |||
@@ -26,4 +26,5 @@ | |||
26 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND | 26 | #define __ARCH_WANT_COMPAT_SYS_RT_SIGSUSPEND |
27 | #define __ARCH_WANT_COMPAT_SYS_SENDFILE | 27 | #define __ARCH_WANT_COMPAT_SYS_SENDFILE |
28 | #endif | 28 | #endif |
29 | #define __ARCH_WANT_SYS_EXECVE | ||
29 | #include <uapi/asm/unistd.h> | 30 | #include <uapi/asm/unistd.h> |
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 6d909faebf28..9035e6add3e4 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h | |||
@@ -32,7 +32,7 @@ __SYSCALL(7, sys_ni_syscall) /* 7 was sys_waitpid */ | |||
32 | __SYSCALL(8, sys_creat) | 32 | __SYSCALL(8, sys_creat) |
33 | __SYSCALL(9, sys_link) | 33 | __SYSCALL(9, sys_link) |
34 | __SYSCALL(10, sys_unlink) | 34 | __SYSCALL(10, sys_unlink) |
35 | __SYSCALL(11, compat_sys_execve_wrapper) | 35 | __SYSCALL(11, compat_sys_execve) |
36 | __SYSCALL(12, sys_chdir) | 36 | __SYSCALL(12, sys_chdir) |
37 | __SYSCALL(13, sys_ni_syscall) /* 13 was sys_time */ | 37 | __SYSCALL(13, sys_ni_syscall) /* 13 was sys_time */ |
38 | __SYSCALL(14, sys_mknod) | 38 | __SYSCALL(14, sys_mknod) |
diff --git a/arch/arm64/kernel/entry.S b/arch/arm64/kernel/entry.S index 00daf922733e..616531862d52 100644 --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S | |||
@@ -676,11 +676,6 @@ __sys_trace_return: | |||
676 | /* | 676 | /* |
677 | * Special system call wrappers. | 677 | * Special system call wrappers. |
678 | */ | 678 | */ |
679 | ENTRY(sys_execve_wrapper) | ||
680 | mov x3, sp | ||
681 | b sys_execve | ||
682 | ENDPROC(sys_execve_wrapper) | ||
683 | |||
684 | ENTRY(sys_clone_wrapper) | 679 | ENTRY(sys_clone_wrapper) |
685 | mov x5, sp | 680 | mov x5, sp |
686 | b sys_clone | 681 | b sys_clone |
diff --git a/arch/arm64/kernel/sys.c b/arch/arm64/kernel/sys.c index 4deb0d0093cd..9c77c0bacc1d 100644 --- a/arch/arm64/kernel/sys.c +++ b/arch/arm64/kernel/sys.c | |||
@@ -41,27 +41,6 @@ asmlinkage long sys_clone(unsigned long clone_flags, unsigned long newsp, | |||
41 | return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr); | 41 | return do_fork(clone_flags, newsp, regs, 0, parent_tidptr, child_tidptr); |
42 | } | 42 | } |
43 | 43 | ||
44 | /* | ||
45 | * sys_execve() executes a new program. | ||
46 | */ | ||
47 | asmlinkage long sys_execve(const char __user *filenamei, | ||
48 | const char __user *const __user *argv, | ||
49 | const char __user *const __user *envp, | ||
50 | struct pt_regs *regs) | ||
51 | { | ||
52 | long error; | ||
53 | struct filename *filename; | ||
54 | |||
55 | filename = getname(filenamei); | ||
56 | error = PTR_ERR(filename); | ||
57 | if (IS_ERR(filename)) | ||
58 | goto out; | ||
59 | error = do_execve(filename->name, argv, envp, regs); | ||
60 | putname(filename); | ||
61 | out: | ||
62 | return error; | ||
63 | } | ||
64 | |||
65 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, | 44 | asmlinkage long sys_mmap(unsigned long addr, unsigned long len, |
66 | unsigned long prot, unsigned long flags, | 45 | unsigned long prot, unsigned long flags, |
67 | unsigned long fd, off_t off) | 46 | unsigned long fd, off_t off) |
@@ -75,7 +54,6 @@ asmlinkage long sys_mmap(unsigned long addr, unsigned long len, | |||
75 | /* | 54 | /* |
76 | * Wrappers to pass the pt_regs argument. | 55 | * Wrappers to pass the pt_regs argument. |
77 | */ | 56 | */ |
78 | #define sys_execve sys_execve_wrapper | ||
79 | #define sys_clone sys_clone_wrapper | 57 | #define sys_clone sys_clone_wrapper |
80 | #define sys_rt_sigreturn sys_rt_sigreturn_wrapper | 58 | #define sys_rt_sigreturn sys_rt_sigreturn_wrapper |
81 | #define sys_sigaltstack sys_sigaltstack_wrapper | 59 | #define sys_sigaltstack sys_sigaltstack_wrapper |
diff --git a/arch/arm64/kernel/sys32.S b/arch/arm64/kernel/sys32.S index 54c4aec47a08..92145d402cf1 100644 --- a/arch/arm64/kernel/sys32.S +++ b/arch/arm64/kernel/sys32.S | |||
@@ -36,11 +36,6 @@ compat_sys_vfork_wrapper: | |||
36 | b compat_sys_vfork | 36 | b compat_sys_vfork |
37 | ENDPROC(compat_sys_vfork_wrapper) | 37 | ENDPROC(compat_sys_vfork_wrapper) |
38 | 38 | ||
39 | compat_sys_execve_wrapper: | ||
40 | mov x3, sp | ||
41 | b compat_sys_execve | ||
42 | ENDPROC(compat_sys_execve_wrapper) | ||
43 | |||
44 | compat_sys_clone_wrapper: | 39 | compat_sys_clone_wrapper: |
45 | mov x5, sp | 40 | mov x5, sp |
46 | b compat_sys_clone | 41 | b compat_sys_clone |
diff --git a/arch/arm64/kernel/sys_compat.c b/arch/arm64/kernel/sys_compat.c index 906e3bd270b0..d140b73a8bc4 100644 --- a/arch/arm64/kernel/sys_compat.c +++ b/arch/arm64/kernel/sys_compat.c | |||
@@ -49,24 +49,6 @@ asmlinkage int compat_sys_vfork(struct pt_regs *regs) | |||
49 | regs, 0, NULL, NULL); | 49 | regs, 0, NULL, NULL); |
50 | } | 50 | } |
51 | 51 | ||
52 | asmlinkage int compat_sys_execve(const char __user *filenamei, | ||
53 | compat_uptr_t argv, compat_uptr_t envp, | ||
54 | struct pt_regs *regs) | ||
55 | { | ||
56 | int error; | ||
57 | struct filename *filename; | ||
58 | |||
59 | filename = getname(filenamei); | ||
60 | error = PTR_ERR(filename); | ||
61 | if (IS_ERR(filename)) | ||
62 | goto out; | ||
63 | error = compat_do_execve(filename->name, compat_ptr(argv), | ||
64 | compat_ptr(envp), regs); | ||
65 | putname(filename); | ||
66 | out: | ||
67 | return error; | ||
68 | } | ||
69 | |||
70 | asmlinkage int compat_sys_sched_rr_get_interval(compat_pid_t pid, | 52 | asmlinkage int compat_sys_sched_rr_get_interval(compat_pid_t pid, |
71 | struct compat_timespec __user *interval) | 53 | struct compat_timespec __user *interval) |
72 | { | 54 | { |