Skip to contentSkip to conversation

skd: use regular version of copy_from_user()

PATCH In review Dan Carpenter 2 participants 2 messages Sep 13, 2013

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

PATCH 1/4 skd: use regular version of copy_from_user()

The other __copy_from_user() calls have access_ok() checks so they are fine, but these two don't have the check.

drivers/block/skd_main.c +2 -2
index 6fc0296..dfd05a9 100644
@@ -1736,7 +1736,7 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev,
 		return -EINVAL;
 	}
 
-	if (__copy_from_user(sksgio->cdb, sgp->cmdp, sgp->cmd_len)) {
+	if (copy_from_user(sksgio->cdb, sgp->cmdp, sgp->cmd_len)) {
 		DPRINTK(skdev, "copy_from_user cmdp failed %p\n", sgp->cmdp);
 		return -EFAULT;
 	}
@@ -1767,7 +1767,7 @@ static int skd_sg_io_get_and_check_args(struct skd_device *skdev,
 		sksgio->iov = iov;
 		sksgio->iovcnt = sgp->iovec_count;
 
-		if (__copy_from_user(iov, sgp->dxferp, nbytes)) {
+		if (copy_from_user(iov, sgp->dxferp, nbytes)) {
 			DPRINTK(skdev, "copy_from_user iovec failed %p\n",
 				sgp->dxferp);
 			return -EFAULT;
maintainer
#1 lore raw
Quoted 2 lines · Dan Carpenter

The other __copy_from_user() calls have access_ok() checks so they are fine, but these two don't have the check.

Thanks Dan, applied this one and the other two. Did you miss sending one out? I don't see a 3/4 patch.

Signature · 1 line
Jens Axboe