aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/compat_linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/kernel/compat_linux.c')
-rw-r--r--arch/s390/kernel/compat_linux.c83
1 files changed, 14 insertions, 69 deletions
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 9ab188d67a3d..5519cb745106 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -443,66 +443,28 @@ 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 */
446asmlinkage long sys32_execve(void) 446asmlinkage 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];
467out_putname:
468 putname(filename);
469out: 463out:
470 return result; 464 putname(filename);
471} 465 return rc;
472
473
474#ifdef CONFIG_MODULES
475
476asmlinkage long
477sys32_init_module(void __user *umod, unsigned long len,
478 const char __user *uargs)
479{
480 return sys_init_module(umod, len, uargs);
481}
482
483asmlinkage long
484sys32_delete_module(const char __user *name_user, unsigned int flags)
485{
486 return sys_delete_module(name_user, flags);
487}
488
489#else /* CONFIG_MODULES */
490
491asmlinkage long
492sys32_init_module(void __user *umod, unsigned long len,
493 const char __user *uargs)
494{
495 return -ENOSYS;
496} 466}
497 467
498asmlinkage long
499sys32_delete_module(const char __user *name_user, unsigned int flags)
500{
501 return -ENOSYS;
502}
503
504#endif /* CONFIG_MODULES */
505
506asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf, 468asmlinkage long sys32_pread64(unsigned int fd, char __user *ubuf,
507 size_t count, u32 poshi, u32 poslo) 469 size_t count, u32 poshi, u32 poslo)
508{ 470{
@@ -801,23 +763,6 @@ asmlinkage long sys32_write(unsigned int fd, char __user * buf, size_t count)
801 return sys_write(fd, buf, count); 763 return sys_write(fd, buf, count);
802} 764}
803 765
804asmlinkage long sys32_clone(void)
805{
806 struct pt_regs *regs = task_pt_regs(current);
807 unsigned long clone_flags;
808 unsigned long newsp;
809 int __user *parent_tidptr, *child_tidptr;
810
811 clone_flags = regs->gprs[3] & 0xffffffffUL;
812 newsp = regs->orig_gpr2 & 0x7fffffffUL;
813 parent_tidptr = compat_ptr(regs->gprs[4]);
814 child_tidptr = compat_ptr(regs->gprs[5]);
815 if (!newsp)
816 newsp = regs->gprs[15];
817 return do_fork(clone_flags, newsp, regs, 0,
818 parent_tidptr, child_tidptr);
819}
820
821/* 766/*
822 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64. 767 * 31 bit emulation wrapper functions for sys_fadvise64/fadvise64_64.
823 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE} 768 * These need to rewrite the advise values for POSIX_FADV_{DONTNEED,NOREUSE}