lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100106173258.GJ9882@parisc-linux.org>
Date:	Wed, 6 Jan 2010 10:32:59 -0700
From:	Matthew Wilcox <matthew@....cx>
To:	Christoph Hellwig <hch@....de>
Cc:	akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
	linux-arch@...r.kernel.org, linux@....linux.org.uk,
	dhowells@...hat.com, ysato@...rs.sourceforge.jp,
	tony.luck@...el.com, geert@...ux-m68k.org, zippel@...ux-m68k.org,
	gerg@...inux.org, schwidefsky@...ibm.com,
	heiko.carstens@...ibm.com, jdike@...toit.com, tglx@...utronix.de,
	mingo@...hat.com, hpa@...or.com, viro@...iv.linux.org.uk
Subject: Re: [PATCH 1/3] generic sys_old_select

On Wed, Jan 06, 2010 at 06:21:12PM +0100, Christoph Hellwig wrote:
> Add a generic implementation of the old select syscall, which expects it's
> argument in a memory block and switch all architectures over to use it.

Don't we want an ifdef around compat_sys_old_select() like the one
around sys_old_select()?

> Index: linux-2.6/fs/select.c
> ===================================================================
> --- linux-2.6.orig/fs/select.c	2009-12-17 09:39:54.792277244 +0100
> +++ linux-2.6/fs/select.c	2009-12-26 13:39:31.501255812 +0100
> @@ -691,6 +691,23 @@ SYSCALL_DEFINE6(pselect6, int, n, fd_set
>  }
>  #endif /* HAVE_SET_RESTORE_SIGMASK */
>  
> +#ifdef __ARCH_WANT_SYS_OLD_SELECT
> +struct sel_arg_struct {
> +	unsigned long n;
> +	fd_set __user *inp, *outp, *exp;
> +	struct timeval __user *tvp;
> +};
> +
> +SYSCALL_DEFINE1(old_select, struct sel_arg_struct __user *, arg)
> +{
> +	struct sel_arg_struct a;
> +
> +	if (copy_from_user(&a, arg, sizeof(a)))
> +		return -EFAULT;
> +	return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp);
> +}
> +#endif
> +
>  struct poll_list {
>  	struct poll_list *next;
>  	int len;
> Index: linux-2.6/fs/compat.c
> ===================================================================
> --- linux-2.6.orig/fs/compat.c	2009-12-26 13:43:52.431003939 +0100
> +++ linux-2.6/fs/compat.c	2009-12-26 13:49:24.179256485 +0100
> @@ -1795,6 +1795,24 @@ asmlinkage long compat_sys_select(int n,
>  	return ret;
>  }
>  
> +struct compat_sel_arg_struct {
> +	compat_ulong_t n;
> +	compat_ulong_t inp;
> +	compat_ulong_t outp;
> +	compat_ulong_t exp;
> +	compat_ulong_t tvp;
> +};
> +
> +asmlinkage long compat_sys_old_select(struct compat_sel_arg_struct __user *arg)
> +{
> +	struct compat_sel_arg_struct a;
> +
> +	if (copy_from_user(&a, arg, sizeof(a)))
> +		return -EFAULT;
> +	return compat_sys_select(a.n, compat_ptr(a.inp), compat_ptr(a.outp),
> +				 compat_ptr(a.exp), compat_ptr(a.tvp));
> +}
> +
>  #ifdef HAVE_SET_RESTORE_SIGMASK
>  static long do_compat_pselect(int n, compat_ulong_t __user *inp,
>  	compat_ulong_t __user *outp, compat_ulong_t __user *exp,

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ