diff options
Diffstat (limited to 'arch/s390/kernel/process.c')
-rw-r--r-- | arch/s390/kernel/process.c | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 5a43f27eec13..59fe6ecc6ed3 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/elfcore.h> | 32 | #include <linux/elfcore.h> |
33 | #include <linux/kernel_stat.h> | 33 | #include <linux/kernel_stat.h> |
34 | #include <linux/syscalls.h> | 34 | #include <linux/syscalls.h> |
35 | #include <linux/compat.h> | ||
35 | #include <asm/compat.h> | 36 | #include <asm/compat.h> |
36 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
37 | #include <asm/pgtable.h> | 38 | #include <asm/pgtable.h> |
@@ -230,17 +231,11 @@ SYSCALL_DEFINE0(fork) | |||
230 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); | 231 | return do_fork(SIGCHLD, regs->gprs[15], regs, 0, NULL, NULL); |
231 | } | 232 | } |
232 | 233 | ||
233 | SYSCALL_DEFINE0(clone) | 234 | SYSCALL_DEFINE4(clone, unsigned long, newsp, unsigned long, clone_flags, |
235 | int __user *, parent_tidptr, int __user *, child_tidptr) | ||
234 | { | 236 | { |
235 | struct pt_regs *regs = task_pt_regs(current); | 237 | struct pt_regs *regs = task_pt_regs(current); |
236 | unsigned long clone_flags; | ||
237 | unsigned long newsp; | ||
238 | int __user *parent_tidptr, *child_tidptr; | ||
239 | 238 | ||
240 | clone_flags = regs->gprs[3]; | ||
241 | newsp = regs->orig_gpr2; | ||
242 | parent_tidptr = (int __user *) regs->gprs[4]; | ||
243 | child_tidptr = (int __user *) regs->gprs[5]; | ||
244 | if (!newsp) | 239 | if (!newsp) |
245 | newsp = regs->gprs[15]; | 240 | newsp = regs->gprs[15]; |
246 | return do_fork(clone_flags, newsp, regs, 0, | 241 | return do_fork(clone_flags, newsp, regs, 0, |
@@ -274,30 +269,25 @@ asmlinkage void execve_tail(void) | |||
274 | /* | 269 | /* |
275 | * sys_execve() executes a new program. | 270 | * sys_execve() executes a new program. |
276 | */ | 271 | */ |
277 | SYSCALL_DEFINE0(execve) | 272 | SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv, |
273 | char __user * __user *, envp) | ||
278 | { | 274 | { |
279 | struct pt_regs *regs = task_pt_regs(current); | 275 | struct pt_regs *regs = task_pt_regs(current); |
280 | char *filename; | 276 | char *filename; |
281 | unsigned long result; | 277 | long rc; |
282 | int rc; | ||
283 | 278 | ||
284 | filename = getname((char __user *) regs->orig_gpr2); | 279 | filename = getname(name); |
285 | if (IS_ERR(filename)) { | 280 | rc = PTR_ERR(filename); |
286 | result = PTR_ERR(filename); | 281 | if (IS_ERR(filename)) |
282 | return rc; | ||
283 | rc = do_execve(filename, argv, envp, regs); | ||
284 | if (rc) | ||
287 | goto out; | 285 | goto out; |
288 | } | ||
289 | rc = do_execve(filename, (char __user * __user *) regs->gprs[3], | ||
290 | (char __user * __user *) regs->gprs[4], regs); | ||
291 | if (rc) { | ||
292 | result = rc; | ||
293 | goto out_putname; | ||
294 | } | ||
295 | execve_tail(); | 286 | execve_tail(); |
296 | result = regs->gprs[2]; | 287 | rc = regs->gprs[2]; |
297 | out_putname: | ||
298 | putname(filename); | ||
299 | out: | 288 | out: |
300 | return result; | 289 | putname(filename); |
290 | return rc; | ||
301 | } | 291 | } |
302 | 292 | ||
303 | /* | 293 | /* |