mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Eric W. Biederman" <ebiederm@xmission.com>
To: <linux-arch@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Carsten Otte <cotte@de.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>
Subject: [PATCH 07/11] sysctl: s390 Use the compat_sys_sysctl
Date: Thu,  5 Nov 2009 16:41:50 -0800	[thread overview]
Message-ID: <1257468114-6823-7-git-send-email-ebiederm@xmission.com> (raw)
In-Reply-To: <m1tyx8trik.fsf@fess.ebiederm.org>

From: Eric W. Biederman <ebiederm@xmission.com>

Now that we have a generic 32bit compatibility implementation
there is no need for s390 to implement it's own.

Cc: Carsten Otte <cotte@de.ibm.com>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/s390/kernel/compat_linux.c   |   53 -------------------------------------
 arch/s390/kernel/compat_linux.h   |    2 -
 arch/s390/kernel/compat_wrapper.S |    6 +---
 3 files changed, 2 insertions(+), 59 deletions(-)

diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 0debcec..fda1a81 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
 	return ret;
 }
 
-#ifdef CONFIG_SYSCTL_SYSCALL
-struct __sysctl_args32 {
-	u32 name;
-	int nlen;
-	u32 oldval;
-	u32 oldlenp;
-	u32 newval;
-	u32 newlen;
-	u32 __unused[4];
-};
-
-asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
-{
-	struct __sysctl_args32 tmp;
-	int error;
-	size_t oldlen;
-	size_t __user *oldlenp = NULL;
-	unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
-
-	if (copy_from_user(&tmp, args, sizeof(tmp)))
-		return -EFAULT;
-
-	if (tmp.oldval && tmp.oldlenp) {
-		/* Duh, this is ugly and might not work if sysctl_args
-		   is in read-only memory, but do_sysctl does indirectly
-		   a lot of uaccess in both directions and we'd have to
-		   basically copy the whole sysctl.c here, and
-		   glibc's __sysctl uses rw memory for the structure
-		   anyway.  */
-		if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) ||
-		    put_user(oldlen, (size_t __user *)addr))
-			return -EFAULT;
-		oldlenp = (size_t __user *)addr;
-	}
-
-	lock_kernel();
-	error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
-			  oldlenp, compat_ptr(tmp.newval), tmp.newlen);
-	unlock_kernel();
-	if (oldlenp) {
-		if (!error) {
-			if (get_user(oldlen, (size_t __user *)addr) ||
-			    put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
-				error = -EFAULT;
-		}
-		if (copy_to_user(args->__unused, tmp.__unused,
-				 sizeof(tmp.__unused)))
-			error = -EFAULT;
-	}
-	return error;
-}
-#endif
-
 struct stat64_emu31 {
 	unsigned long long  st_dev;
 	unsigned int    __pad1;
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index c07f9ca..45e9092 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -162,7 +162,6 @@ struct ucontext32 {
 	compat_sigset_t		uc_sigmask;	/* mask last for extensibility */
 };
 
-struct __sysctl_args32;
 struct stat64_emu31;
 struct mmap_arg_struct_emu31;
 struct fadvise64_64_args;
@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
 		    size_t count);
 long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
 		      s32 count);
-long sys32_sysctl(struct __sysctl_args32 __user *args);
 long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
 long sys32_lstat64(char __user * filename,
 		   struct stat64_emu31 __user * statbuf);
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index cbd9901..30de2d0 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper:
 	llgfr	%r2,%r2			# unsigned int
 	jg	sys_fdatasync		# branch to system call
 
-#sys32_sysctl_wrapper			# tbd
-
 	.globl	sys32_mlock_wrapper
 sys32_mlock_wrapper:
 	llgfr	%r2,%r2			# unsigned long
@@ -1087,8 +1085,8 @@ sys32_stime_wrapper:
 
 	.globl	sys32_sysctl_wrapper
 sys32_sysctl_wrapper:
-	llgtr	%r2,%r2 		# struct __sysctl_args32 *
-	jg	sys32_sysctl
+	llgtr	%r2,%r2 		# struct compat_sysctl_args *
+	jg	compat_sys_sysctl
 
 	.globl	sys32_fstat64_wrapper
 sys32_fstat64_wrapper:
-- 
1.6.5.2.143.g8cc62


  parent reply	other threads:[~2009-11-06  0:43 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-06  0:40 [PATCH 0/11] generic compat_sys_sysctl Eric W. Biederman
2009-11-06  0:41 ` [PATCH 01/11] sysctl: Separate the binary sysctl logic into it's own file Eric W. Biederman
2009-11-06  9:04   ` Christian Borntraeger
2009-11-06 11:33     ` Eric W. Biederman
2009-11-06 12:10       ` Arnd Bergmann
2009-11-06 12:55         ` Eric W. Biederman
2009-11-06 13:11           ` Arnd Bergmann
2009-11-06 13:58             ` Eric W. Biederman
2009-11-06  0:41 ` [PATCH 02/11] sysctl: Refactor the binary sysctl handling to remove duplicate code Eric W. Biederman
2009-11-06  0:41 ` [PATCH 03/11] sysctl: Introduce a generic compat sysctl sysctl Eric W. Biederman
2009-11-06  0:41 ` [PATCH 04/11] sysctl: ia64 Use the compat_sys_sysctl Eric W. Biederman
2009-11-06  0:41 ` [PATCH 05/11] sysctl: mips " Eric W. Biederman
2009-11-06  0:41 ` [PATCH 06/11] sysctl: parisc " Eric W. Biederman
2009-11-06  6:01   ` Kyle McMartin
2009-11-06  0:41 ` Eric W. Biederman [this message]
2009-11-06  9:12   ` [PATCH 07/11] sysctl: s390 " Christian Borntraeger
2009-11-06 10:19     ` Eric W. Biederman
2009-11-06  9:23   ` Martin Schwidefsky
2009-11-06  0:41 ` [PATCH 08/11] sysctl: sparc " Eric W. Biederman
2009-11-06  1:42   ` David Miller
2009-11-06  0:41 ` [PATCH 09/11] sysctl: x86 " Eric W. Biederman
2009-11-06  0:56   ` H. Peter Anvin
2009-11-06  1:15     ` Eric W. Biederman
2009-11-06  0:41 ` [PATCH 10/11] sysctl: Remove the cond_syscall entry for sys32_sysctl Eric W. Biederman
2009-11-06  0:41 ` [PATCH 11/11] sysctl: Make do_sysctl static Eric W. Biederman
2009-11-06  0:48 ` [PATCH 0/11] generic compat_sys_sysctl Eric W. Biederman
2009-11-06 10:27 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1257468114-6823-7-git-send-email-ebiederm@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®