diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-31 15:48:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-30 23:35:51 -0400 |
commit | be6abfa769fa07ce89ac73273360b335ae978805 (patch) | |
tree | e6b9ba23767a93839c5e4e14f197d4781bf95cf4 /arch/powerpc/kernel/process.c | |
parent | 58254e1002a82eb383c5977ad9fd5a451b91fe29 (diff) | |
download | op-kernel-dev-be6abfa769fa07ce89ac73273360b335ae978805.zip op-kernel-dev-be6abfa769fa07ce89ac73273360b335ae978805.tar.gz |
powerpc: switch to generic sys_execve()/kernel_execve()
the only non-obvious part is that current_pt_regs() is really needed
here - task_pt_regs() is NULL for kernel threads; it's OK for ptrace
uses (the thing task_pt_regs() is intended for), but not for us.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 3b06898..6fdf044 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -1064,26 +1064,13 @@ int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3, regs, 0, NULL, NULL); } -int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, - unsigned long a3, unsigned long a4, unsigned long a5, - struct pt_regs *regs) +void __ret_from_kernel_execve(struct pt_regs *normal) +__noreturn; + +void ret_from_kernel_execve(struct pt_regs *normal) { - int error; - char *filename; - - filename = getname((const char __user *) a0); - error = PTR_ERR(filename); - if (IS_ERR(filename)) - goto out; - flush_fp_to_thread(current); - flush_altivec_to_thread(current); - flush_spe_to_thread(current); - error = do_execve(filename, - (const char __user *const __user *) a1, - (const char __user *const __user *) a2, regs); - putname(filename); -out: - return error; + set_thread_flag(TIF_RESTOREALL); + __ret_from_kernel_execve(normal); } static inline int valid_irq_stack(unsigned long sp, struct task_struct *p, |