diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-09-22 16:58:42 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-09-22 16:58:43 -0400 |
commit | 3e86a8c617413e344143839c514e9b0c1713065c (patch) | |
tree | d979f64645e47d37b273787faf6bc834550e3963 /arch/s390 | |
parent | 2d70ca23f86647e076e3a8b64b3a90e583b894d5 (diff) |
[S390] Convert sys_execve to function with parameters.
Use function parameters instead of accessing the pt_regs structure
to get the parameters.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kernel/compat_linux.c | 33 | ||||
-rw-r--r-- | arch/s390/kernel/compat_linux.h | 3 | ||||
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 7 | ||||
-rw-r--r-- | arch/s390/kernel/entry.h | 3 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 30 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 2 |
6 files changed, 39 insertions, 39 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c index f741cd49111a..05cf446e60b2 100644 --- a/arch/s390/kernel/compat_linux.c +++ b/arch/s390/kernel/compat_linux.c | |||
@@ -443,31 +443,26 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) | |||
443 | * sys32_execve() executes a new program after the asm stub has set | 443 | * sys32_execve() executes a new program after the asm stub has set |
444 | * things up for us. This should basically do what I want it to. | 444 | * things up for us. This should basically do what I want it to. |
445 | */ | 445 | */ |
446 | asmlinkage long sys32_execve(void) | 446 | asmlinkage long sys32_execve(char __user *name, compat_uptr_t __user *argv, |
447 | compat_uptr_t __user *envp) | ||
447 | { | 448 | { |
448 | struct pt_regs *regs = task_pt_regs(current); | 449 | struct pt_regs *regs = task_pt_regs(current); |
449 | char *filename; | 450 | char *filename; |
450 | unsigned long result; | 451 | long rc; |
451 | int rc; | 452 | |
452 | 453 | filename = getname(name); | |
453 | filename = getname(compat_ptr(regs->orig_gpr2)); | 454 | rc = PTR_ERR(filename); |
454 | if (IS_ERR(filename)) { | 455 | if (IS_ERR(filename)) |
455 | result = PTR_ERR(filename); | 456 | return rc; |
456 | goto out; | 457 | rc = compat_do_execve(filename, argv, envp, regs); |
457 | } | 458 | if (rc) |
458 | rc = compat_do_execve(filename, compat_ptr(regs->gprs[3]), | 459 | goto out; |
459 | compat_ptr(regs->gprs[4]), regs); | ||
460 | if (rc) { | ||
461 | result = rc; | ||
462 | goto out_putname; | ||
463 | } | ||
464 | current->thread.fp_regs.fpc=0; | 460 | current->thread.fp_regs.fpc=0; |
465 | asm volatile("sfpc %0,0" : : "d" (0)); | 461 | asm volatile("sfpc %0,0" : : "d" (0)); |
466 | result = regs->gprs[2]; | 462 | rc = regs->gprs[2]; |
467 | out_putname: | ||
468 | putname(filename); | ||
469 | out: | 463 | out: |
470 | return result; | 464 | putname(filename); |
465 | return rc; | ||
471 | } | 466 | } |
472 | 467 | ||
473 | 468 | ||
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h index 7cceb67ff8a2..c07f9ca05ade 100644 --- a/arch/s390/kernel/compat_linux.h +++ b/arch/s390/kernel/compat_linux.h | |||
@@ -198,7 +198,8 @@ long sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | |||
198 | compat_sigset_t __user *oset, size_t sigsetsize); | 198 | compat_sigset_t __user *oset, size_t sigsetsize); |
199 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); | 199 | long sys32_rt_sigpending(compat_sigset_t __user *set, size_t sigsetsize); |
200 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); | 200 | long sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo); |
201 | long sys32_execve(void); | 201 | long sys32_execve(char __user *name, compat_uptr_t __user *argv, |
202 | compat_uptr_t __user *envp); | ||
202 | long sys32_init_module(void __user *umod, unsigned long len, | 203 | long sys32_init_module(void __user *umod, unsigned long len, |
203 | const char __user *uargs); | 204 | const char __user *uargs); |
204 | long sys32_delete_module(const char __user *name_user, unsigned int flags); | 205 | long sys32_delete_module(const char __user *name_user, unsigned int flags); |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 28f8440d2ec3..8a6a7969c623 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1848,3 +1848,10 @@ sys_clone_wrapper: | |||
1848 | llgtr %r4,%r4 # int * | 1848 | llgtr %r4,%r4 # int * |
1849 | llgtr %r5,%r5 # int * | 1849 | llgtr %r5,%r5 # int * |
1850 | jg sys_clone # branch to system call | 1850 | jg sys_clone # branch to system call |
1851 | |||
1852 | .globl sys32_execve_wrapper | ||
1853 | sys32_execve_wrapper: | ||
1854 | llgtr %r2,%r2 # char * | ||
1855 | llgtr %r3,%r3 # compat_uptr_t * | ||
1856 | llgtr %r4,%r4 # compat_uptr_t * | ||
1857 | jg sys32_execve # branch to system call | ||
diff --git a/arch/s390/kernel/entry.h b/arch/s390/kernel/entry.h index 91fd78839c57..e1e5e767ab56 100644 --- a/arch/s390/kernel/entry.h +++ b/arch/s390/kernel/entry.h | |||
@@ -46,7 +46,8 @@ long sys_clone(unsigned long newsp, unsigned long clone_flags, | |||
46 | int __user *parent_tidptr, int __user *child_tidptr); | 46 | int __user *parent_tidptr, int __user *child_tidptr); |
47 | long sys_vfork(void); | 47 | long sys_vfork(void); |
48 | void execve_tail(void); | 48 | void execve_tail(void); |
49 | long sys_execve(void); | 49 | long sys_execve(char __user *name, char __user * __user *argv, |
50 | char __user * __user *envp); | ||
50 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); | 51 | long sys_sigsuspend(int history0, int history1, old_sigset_t mask); |
51 | long sys_sigaction(int sig, const struct old_sigaction __user *act, | 52 | long sys_sigaction(int sig, const struct old_sigaction __user *act, |
52 | struct old_sigaction __user *oact); | 53 | struct old_sigaction __user *oact); |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 189d978f76d6..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> |
@@ -268,30 +269,25 @@ asmlinkage void execve_tail(void) | |||
268 | /* | 269 | /* |
269 | * sys_execve() executes a new program. | 270 | * sys_execve() executes a new program. |
270 | */ | 271 | */ |
271 | SYSCALL_DEFINE0(execve) | 272 | SYSCALL_DEFINE3(execve, char __user *, name, char __user * __user *, argv, |
273 | char __user * __user *, envp) | ||
272 | { | 274 | { |
273 | struct pt_regs *regs = task_pt_regs(current); | 275 | struct pt_regs *regs = task_pt_regs(current); |
274 | char *filename; | 276 | char *filename; |
275 | unsigned long result; | 277 | long rc; |
276 | int rc; | ||
277 | 278 | ||
278 | filename = getname((char __user *) regs->orig_gpr2); | 279 | filename = getname(name); |
279 | if (IS_ERR(filename)) { | 280 | rc = PTR_ERR(filename); |
280 | result = PTR_ERR(filename); | 281 | if (IS_ERR(filename)) |
282 | return rc; | ||
283 | rc = do_execve(filename, argv, envp, regs); | ||
284 | if (rc) | ||
281 | goto out; | 285 | goto out; |
282 | } | ||
283 | rc = do_execve(filename, (char __user * __user *) regs->gprs[3], | ||
284 | (char __user * __user *) regs->gprs[4], regs); | ||
285 | if (rc) { | ||
286 | result = rc; | ||
287 | goto out_putname; | ||
288 | } | ||
289 | execve_tail(); | 286 | execve_tail(); |
290 | result = regs->gprs[2]; | 287 | rc = regs->gprs[2]; |
291 | out_putname: | ||
292 | putname(filename); | ||
293 | out: | 288 | out: |
294 | return result; | 289 | putname(filename); |
290 | return rc; | ||
295 | } | 291 | } |
296 | 292 | ||
297 | /* | 293 | /* |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index ff79d58e0eb3..062dd8f92377 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -19,7 +19,7 @@ SYSCALL(sys_restart_syscall,sys_restart_syscall,sys_restart_syscall) | |||
19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) | 19 | SYSCALL(sys_creat,sys_creat,sys32_creat_wrapper) |
20 | SYSCALL(sys_link,sys_link,sys32_link_wrapper) | 20 | SYSCALL(sys_link,sys_link,sys32_link_wrapper) |
21 | SYSCALL(sys_unlink,sys_unlink,sys32_unlink_wrapper) /* 10 */ | 21 | SYSCALL(sys_unlink,sys_unlink,sys32_unlink_wrapper) /* 10 */ |
22 | SYSCALL(sys_execve,sys_execve,sys32_execve) | 22 | SYSCALL(sys_execve,sys_execve,sys32_execve_wrapper) |
23 | SYSCALL(sys_chdir,sys_chdir,sys32_chdir_wrapper) | 23 | SYSCALL(sys_chdir,sys_chdir,sys32_chdir_wrapper) |
24 | SYSCALL(sys_time,sys_ni_syscall,sys32_time_wrapper) /* old time syscall */ | 24 | SYSCALL(sys_time,sys_ni_syscall,sys32_time_wrapper) /* old time syscall */ |
25 | SYSCALL(sys_mknod,sys_mknod,sys32_mknod_wrapper) | 25 | SYSCALL(sys_mknod,sys_mknod,sys32_mknod_wrapper) |