From: Alexey Zaytsev Date: Wed, 10 Jun 2009 19:56:56 +0000 (-0700) Subject: [SCSI] compat: don't perform unneeded copy in sg_io code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=df59c0ad05182329688e514e5a9c3836fa208ea3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [SCSI] compat: don't perform unneeded copy in sg_io code 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 Acked-by: Jens Axboe Acked-by: FUJITA Tomonori Signed-off-by: Andrew Morton Signed-off-by: James Bottomley --- diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index b83f6bcfa51a..905523cc281f 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -788,12 +788,6 @@ static int sg_ioctl_trans(unsigned int fd, unsigned int cmd, unsigned long arg) 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) {