Skip to contentSkip to conversation

sg_io: don't perform unneeded copy in compat code

PATCH In review [email protected] 2 participants 2 messages Feb 11, 2009 – Feb 12, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 10/11 sg_io: don't perform unneeded copy in compat code

From: Alexey Zaytsev <[email protected]>

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.

Cc Douglas Gilbert <[email protected]>
Cc James Bottomley <[email protected]>
Cc Jens Axboe <[email protected]>
Cc FUJITA Tomonori <[email protected]>

---

 fs/compat_ioctl.c |    6 ------
 1 file changed, 6 deletions(-)
fs/compat_ioctl.c renamed from fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code +0 -6
diff -puN fs/compat_ioctl.c~sg_io-dont-perform-unneeded-copy-in-compat-code 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) {

_

#1 lore raw
Quoted 12 lines · On Wed, 11 Feb 2009 13:29:38 -0800 [email protected] wrote:

From: Alexey Zaytsev <[email protected]>

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.

Cc Douglas Gilbert <[email protected]>
Cc James Bottomley <[email protected]>
Cc Jens Axboe <[email protected]>
Cc FUJITA Tomonori <[email protected]>
Quoted 4 lines

---

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

Looks fine to me.