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) |
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 3b06898fa17..6fdf044f475 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, | |||
1064 | regs, 0, NULL, NULL); | 1064 | regs, 0, NULL, NULL); |
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2, | 1067 | void __ret_from_kernel_execve(struct pt_regs *normal) |
1068 | unsigned long a3, unsigned long a4, unsigned long a5, | 1068 | __noreturn; |
1069 | struct pt_regs *regs) | 1069 | |
1070 | void ret_from_kernel_execve(struct pt_regs *normal) | ||
1070 | { | 1071 | { |
1071 | int error; | 1072 | set_thread_flag(TIF_RESTOREALL); |
1072 | char *filename; | 1073 | __ret_from_kernel_execve(normal); |
1073 | |||
1074 | filename = getname((const char __user *) a0); | ||
1075 | error = PTR_ERR(filename); | ||
1076 | if (IS_ERR(filename)) | ||
1077 | goto out; | ||
1078 | flush_fp_to_thread(current); | ||
1079 | flush_altivec_to_thread(current); | ||
1080 | flush_spe_to_thread(current); | ||
1081 | error = do_execve(filename, | ||
1082 | (const char __user *const __user *) a1, | ||
1083 | (const char __user *const __user *) a2, regs); | ||
1084 | putname(filename); | ||
1085 | out: | ||
1086 | return error; | ||
1087 | } | 1074 | } |
1088 | 1075 | ||
1089 | static inline int valid_irq_stack(unsigned long sp, struct task_struct *p, | 1076 | static inline int valid_irq_stack(unsigned long sp, struct task_struct *p, |