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>,
	Tony Luck <tony.luck@intel.com>,
	Fenghua Yu <fenghua.yu@intel.com>
Subject: [PATCH 04/11] sysctl: ia64 Use the compat_sys_sysctl
Date: Thu,  5 Nov 2009 16:41:47 -0800	[thread overview]
Message-ID: <1257468114-6823-4-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 ia64 to implement it's own.

Cc: Tony Luck <tony.luck@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
---
 arch/ia64/ia32/ia32_entry.S |    2 +-
 arch/ia64/ia32/sys_ia32.c   |   55 -------------------------------------------
 2 files changed, 1 insertions(+), 56 deletions(-)

diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index af9405c..10c3751 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -327,7 +327,7 @@ ia32_syscall_table:
 	data8 compat_sys_writev
 	data8 sys_getsid
 	data8 sys_fdatasync
-	data8 sys32_sysctl
+	data8 compat_sys_sysctl
 	data8 sys_mlock		  /* 150 */
 	data8 sys_munlock
 	data8 sys_mlockall
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 625ed8f..429ec96 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags)
 	return sys_msync(addr, len + (start - addr), flags);
 }
 
-struct sysctl32 {
-	unsigned int	name;
-	int		nlen;
-	unsigned int	oldval;
-	unsigned int	oldlenp;
-	unsigned int	newval;
-	unsigned int	newlen;
-	unsigned int	__unused[4];
-};
-
-#ifdef CONFIG_SYSCTL_SYSCALL
-asmlinkage long
-sys32_sysctl (struct sysctl32 __user *args)
-{
-	struct sysctl32 a32;
-	mm_segment_t old_fs = get_fs ();
-	void __user *oldvalp, *newvalp;
-	size_t oldlen;
-	int __user *namep;
-	long ret;
-
-	if (copy_from_user(&a32, args, sizeof(a32)))
-		return -EFAULT;
-
-	/*
-	 * We need to pre-validate these because we have to disable address checking
-	 * before calling do_sysctl() because of OLDLEN but we can't run the risk of the
-	 * user specifying bad addresses here.  Well, since we're dealing with 32 bit
-	 * addresses, we KNOW that access_ok() will always succeed, so this is an
-	 * expensive NOP, but so what...
-	 */
-	namep = (int __user *) compat_ptr(a32.name);
-	oldvalp = compat_ptr(a32.oldval);
-	newvalp = compat_ptr(a32.newval);
-
-	if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp)))
-	    || !access_ok(VERIFY_WRITE, namep, 0)
-	    || !access_ok(VERIFY_WRITE, oldvalp, 0)
-	    || !access_ok(VERIFY_WRITE, newvalp, 0))
-		return -EFAULT;
-
-	set_fs(KERNEL_DS);
-	lock_kernel();
-	ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
-			newvalp, (size_t) a32.newlen);
-	unlock_kernel();
-	set_fs(old_fs);
-
-	if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
-		return -EFAULT;
-
-	return ret;
-}
-#endif
-
 asmlinkage long
 sys32_newuname (struct new_utsname __user *name)
 {
-- 
1.6.5.2.143.g8cc62


  parent reply	other threads:[~2009-11-06  0:44 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 ` Eric W. Biederman [this message]
2009-11-06  0:41 ` [PATCH 05/11] sysctl: mips Use the compat_sys_sysctl 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 ` [PATCH 07/11] sysctl: s390 " Eric W. Biederman
2009-11-06  9:12   ` 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-4-git-send-email-ebiederm@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=fenghua.yu@intel.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    /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®