From: akpm@linux-foundation.org Subject: [patch 10/11] sg_io: don't perform unneeded copy in compat code Date: Wed, 11 Feb 2009 13:29:38 -0800 Message-ID: <200902112129.n1BLTdk4002476@imap1.linux-foundation.org> Return-path: Received: from smtp1.linux-foundation.org ([140.211.169.13]:54730 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755292AbZBKV7l (ORCPT ); Wed, 11 Feb 2009 16:59:41 -0500 Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: James.Bottomley@HansenPartnership.com Cc: linux-scsi@vger.kernel.org, akpm@linux-foundation.org, alexey.zaytsev@gmail.com, dgilbert@interlog.com, fujita.tomonori@lab.ntt.co.jp, jens.axboe@oracle.com From: Alexey Zaytsev 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 Cc: Douglas Gilbert Cc: James Bottomley Cc: Jens Axboe Cc: FUJITA Tomonori Signed-off-by: Andrew Morton --- 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 @@ -783,12 +783,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) { _