aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-20 13:14:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-10-23 13:40:12 -0400
commit530550651fdfd548d25b6bd5ff4607803540508b (patch)
tree53ed3b2589aa036e6cbd1c870ec3caf52266e531
parent0f8b983812f5ff588d7e3459b203714e4e58a9b2 (diff)
tile: switch to generic sys_execve()
Acked-by: Chris Metcalf <cmetcalf@tilera.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/tile/include/asm/elf.h1
-rw-r--r--arch/tile/include/asm/processor.h1
-rw-r--r--arch/tile/include/asm/syscalls.h3
-rw-r--r--arch/tile/include/asm/unistd.h1
-rw-r--r--arch/tile/kernel/intvec_32.S1
-rw-r--r--arch/tile/kernel/intvec_64.S1
-rw-r--r--arch/tile/kernel/process.c45
-rw-r--r--arch/tile/kernel/sys.c1
8 files changed, 5 insertions, 49 deletions
diff --git a/arch/tile/include/asm/elf.h b/arch/tile/include/asm/elf.h
index f8ccf08f6934..b73e1039c911 100644
--- a/arch/tile/include/asm/elf.h
+++ b/arch/tile/include/asm/elf.h
@@ -148,6 +148,7 @@ extern int arch_setup_additional_pages(struct linux_binprm *bprm,
148#define compat_start_thread(regs, ip, usp) do { \ 148#define compat_start_thread(regs, ip, usp) do { \
149 regs->pc = ptr_to_compat_reg((void *)(ip)); \ 149 regs->pc = ptr_to_compat_reg((void *)(ip)); \
150 regs->sp = ptr_to_compat_reg((void *)(usp)); \ 150 regs->sp = ptr_to_compat_reg((void *)(usp)); \
151 single_step_execve(); \
151 } while (0) 152 } while (0)
152 153
153/* 154/*
diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h
index 9a83e531e843..879073e76586 100644
--- a/arch/tile/include/asm/processor.h
+++ b/arch/tile/include/asm/processor.h
@@ -211,6 +211,7 @@ static inline void start_thread(struct pt_regs *regs,
211{ 211{
212 regs->pc = pc; 212 regs->pc = pc;
213 regs->sp = usp; 213 regs->sp = usp;
214 single_step_execve();
214} 215}
215 216
216/* Free all resources held by a thread. */ 217/* Free all resources held by a thread. */
diff --git a/arch/tile/include/asm/syscalls.h b/arch/tile/include/asm/syscalls.h
index 06f0464cfed9..0d52992f8e05 100644
--- a/arch/tile/include/asm/syscalls.h
+++ b/arch/tile/include/asm/syscalls.h
@@ -68,9 +68,10 @@ long _sys_sigaltstack(const stack_t __user *, stack_t __user *);
68long _sys_rt_sigreturn(void); 68long _sys_rt_sigreturn(void);
69long _sys_clone(unsigned long clone_flags, unsigned long newsp, 69long _sys_clone(unsigned long clone_flags, unsigned long newsp,
70 void __user *parent_tid, void __user *child_tid); 70 void __user *parent_tid, void __user *child_tid);
71long _sys_execve(const char __user *filename, 71long sys_execve(const char __user *filename,
72 const char __user *const __user *argv, 72 const char __user *const __user *argv,
73 const char __user *const __user *envp); 73 const char __user *const __user *envp);
74#define sys_execve sys_execve
74 75
75#include <asm-generic/syscalls.h> 76#include <asm-generic/syscalls.h>
76 77
diff --git a/arch/tile/include/asm/unistd.h b/arch/tile/include/asm/unistd.h
index 6e032a0a268e..dab827dc8acb 100644
--- a/arch/tile/include/asm/unistd.h
+++ b/arch/tile/include/asm/unistd.h
@@ -16,4 +16,5 @@
16#define __ARCH_WANT_SYS_LLSEEK 16#define __ARCH_WANT_SYS_LLSEEK
17#endif 17#endif
18#define __ARCH_WANT_SYS_NEWFSTATAT 18#define __ARCH_WANT_SYS_NEWFSTATAT
19#define __ARCH_WANT_SYS_EXECVE
19#include <uapi/asm/unistd.h> 20#include <uapi/asm/unistd.h>
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S
index 58aad519b7d6..174b837ef926 100644
--- a/arch/tile/kernel/intvec_32.S
+++ b/arch/tile/kernel/intvec_32.S
@@ -1476,7 +1476,6 @@ STD_ENTRY_LOCAL(bad_intr)
1476 }; \ 1476 }; \
1477 STD_ENDPROC(_##x) 1477 STD_ENDPROC(_##x)
1478 1478
1479PTREGS_SYSCALL(sys_execve, r3)
1480PTREGS_SYSCALL(sys_sigaltstack, r2) 1479PTREGS_SYSCALL(sys_sigaltstack, r2)
1481PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0) 1480PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0)
1482PTREGS_SYSCALL(sys_cmpxchg_badaddr, r1) 1481PTREGS_SYSCALL(sys_cmpxchg_badaddr, r1)
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S
index f66bd5f67d44..283efedf67d6 100644
--- a/arch/tile/kernel/intvec_64.S
+++ b/arch/tile/kernel/intvec_64.S
@@ -1205,7 +1205,6 @@ STD_ENTRY_LOCAL(bad_intr)
1205 }; \ 1205 }; \
1206 STD_ENDPROC(_##x) 1206 STD_ENDPROC(_##x)
1207 1207
1208PTREGS_SYSCALL(sys_execve, r3)
1209PTREGS_SYSCALL(sys_sigaltstack, r2) 1208PTREGS_SYSCALL(sys_sigaltstack, r2)
1210PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0) 1209PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0)
1211#ifdef CONFIG_COMPAT 1210#ifdef CONFIG_COMPAT
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
index da6e4d78da6e..58f8fd1f0bc2 100644
--- a/arch/tile/kernel/process.c
+++ b/arch/tile/kernel/process.c
@@ -594,51 +594,6 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
594 parent_tidptr, child_tidptr); 594 parent_tidptr, child_tidptr);
595} 595}
596 596
597/*
598 * sys_execve() executes a new program.
599 */
600SYSCALL_DEFINE4(execve, const char __user *, path,
601 const char __user *const __user *, argv,
602 const char __user *const __user *, envp,
603 struct pt_regs *, regs)
604{
605 long error;
606 struct filename *filename;
607
608 filename = getname(path);
609 error = PTR_ERR(filename);
610 if (IS_ERR(filename))
611 goto out;
612 error = do_execve(filename->name, argv, envp, regs);
613 putname(filename);
614 if (error == 0)
615 single_step_execve();
616out:
617 return error;
618}
619
620#ifdef CONFIG_COMPAT
621long compat_sys_execve(const char __user *path,
622 compat_uptr_t __user *argv,
623 compat_uptr_t __user *envp)
624{
625 long error;
626 struct filename *filename;
627
628 filename = getname(path);
629 error = PTR_ERR(filename);
630 if (IS_ERR(filename))
631 goto out;
632 error = compat_do_execve(filename->name, argv, envp,
633 current_pt_regs());
634 putname(filename);
635 if (error == 0)
636 single_step_execve();
637out:
638 return error;
639}
640#endif
641
642unsigned long get_wchan(struct task_struct *p) 597unsigned long get_wchan(struct task_struct *p)
643{ 598{
644 struct KBacktraceIterator kbt; 599 struct KBacktraceIterator kbt;
diff --git a/arch/tile/kernel/sys.c b/arch/tile/kernel/sys.c
index b08095b402d6..359e76f68838 100644
--- a/arch/tile/kernel/sys.c
+++ b/arch/tile/kernel/sys.c
@@ -107,7 +107,6 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
107#endif 107#endif
108 108
109/* Call the trampolines to manage pt_regs where necessary. */ 109/* Call the trampolines to manage pt_regs where necessary. */
110#define sys_execve _sys_execve
111#define sys_sigaltstack _sys_sigaltstack 110#define sys_sigaltstack _sys_sigaltstack
112#define sys_rt_sigreturn _sys_rt_sigreturn 111#define sys_rt_sigreturn _sys_rt_sigreturn
113#define sys_clone _sys_clone 112#define sys_clone _sys_clone