linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 4/7] sg_io: don't perform unneeded copy in compat code
@ 2009-06-10 19:56 akpm
  2009-06-11 10:31 ` FUJITA Tomonori
  0 siblings, 1 reply; 3+ messages in thread
From: akpm @ 2009-06-10 19:56 UTC (permalink / raw)
  To: James.Bottomley
  Cc: linux-scsi, akpm, alexey.zaytsev, dgilbert, fujita.tomonori,
	jens.axboe

From: Alexey Zaytsev <alexey.zaytsev@gmail.com>

The members from 'status' in struct sg_io_hdr to the last are used to
transfer information from kernel to user space.  The values that user
space sets are just ignored.

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/compat_ioctl.c |    6 ------
 1 file changed, 6 deletions(-)

diff -puN fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code fs/compat_ioctl.c
--- a/fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code
+++ a/fs/compat_ioctl.c
@@ -787,12 +787,6 @@ static int sg_ioctl_trans(unsigned int f
 	if (put_user(compat_ptr(data), &sgio->usr_ptr))
 		return -EFAULT;
 
-	if (copy_in_user(&sgio->status, &sgio32->status,
-			 (4 * sizeof(unsigned char)) +
-			 (2 * sizeof(unsigned short)) +
-			 (3 * sizeof(int))))
-		return -EFAULT;
-
 	err = sys_ioctl(fd, cmd, (unsigned long) sgio);
 
 	if (err >= 0) {
_

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 4/7] sg_io: don't perform unneeded copy in compat code
  2009-06-10 19:56 [patch 4/7] sg_io: don't perform unneeded copy in compat code akpm
@ 2009-06-11 10:31 ` FUJITA Tomonori
  2009-06-11 10:53   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: FUJITA Tomonori @ 2009-06-11 10:31 UTC (permalink / raw)
  To: akpm
  Cc: James.Bottomley, linux-scsi, alexey.zaytsev, dgilbert,
	fujita.tomonori, jens.axboe

On Wed, 10 Jun 2009 12:56:56 -0700
akpm@linux-foundation.org wrote:

> From: Alexey Zaytsev <alexey.zaytsev@gmail.com>
> 
> The members from 'status' in struct sg_io_hdr to the last are used to
> transfer information from kernel to user space.  The values that user
> space sets are just ignored.
> 
> Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
> Cc: Douglas Gilbert <dgilbert@interlog.com>
> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> Cc: Jens Axboe <jens.axboe@oracle.com>
> Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  fs/compat_ioctl.c |    6 ------
>  1 file changed, 6 deletions(-)
> 
> diff -puN fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code fs/compat_ioctl.c
> --- a/fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code
> +++ a/fs/compat_ioctl.c
> @@ -787,12 +787,6 @@ static int sg_ioctl_trans(unsigned int f
>  	if (put_user(compat_ptr(data), &sgio->usr_ptr))
>  		return -EFAULT;
>  
> -	if (copy_in_user(&sgio->status, &sgio32->status,
> -			 (4 * sizeof(unsigned char)) +
> -			 (2 * sizeof(unsigned short)) +
> -			 (3 * sizeof(int))))
> -		return -EFAULT;
> -
>  	err = sys_ioctl(fd, cmd, (unsigned long) sgio);
>  
>  	if (err >= 0) {

Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch 4/7] sg_io: don't perform unneeded copy in compat code
  2009-06-11 10:31 ` FUJITA Tomonori
@ 2009-06-11 10:53   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2009-06-11 10:53 UTC (permalink / raw)
  To: FUJITA Tomonori
  Cc: akpm, James.Bottomley, linux-scsi, alexey.zaytsev, dgilbert

On Thu, Jun 11 2009, FUJITA Tomonori wrote:
> On Wed, 10 Jun 2009 12:56:56 -0700
> akpm@linux-foundation.org wrote:
> 
> > From: Alexey Zaytsev <alexey.zaytsev@gmail.com>
> > 
> > The members from 'status' in struct sg_io_hdr to the last are used to
> > transfer information from kernel to user space.  The values that user
> > space sets are just ignored.
> > 
> > Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
> > Cc: Douglas Gilbert <dgilbert@interlog.com>
> > Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> > Cc: Jens Axboe <jens.axboe@oracle.com>
> > Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > ---
> > 
> >  fs/compat_ioctl.c |    6 ------
> >  1 file changed, 6 deletions(-)
> > 
> > diff -puN fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code fs/compat_ioctl.c
> > --- a/fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code
> > +++ a/fs/compat_ioctl.c
> > @@ -787,12 +787,6 @@ static int sg_ioctl_trans(unsigned int f
> >  	if (put_user(compat_ptr(data), &sgio->usr_ptr))
> >  		return -EFAULT;
> >  
> > -	if (copy_in_user(&sgio->status, &sgio32->status,
> > -			 (4 * sizeof(unsigned char)) +
> > -			 (2 * sizeof(unsigned short)) +
> > -			 (3 * sizeof(int))))
> > -		return -EFAULT;
> > -
> >  	err = sys_ioctl(fd, cmd, (unsigned long) sgio);
> >  
> >  	if (err >= 0) {
> 
> Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

Ditto from me.

Acked-by: Jens Axboe <jens.axboe@oracle.com>

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-06-11 10:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-10 19:56 [patch 4/7] sg_io: don't perform unneeded copy in compat code akpm
2009-06-11 10:31 ` FUJITA Tomonori
2009-06-11 10:53   ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).