staging/lustre/lloop: Properly mark userspace pointers in lo/lloop_ioctl
When casting unsigned long userspace pointer for use with userspace-accessing functions, need to use __user attribute to make sparse happy. Signed-off-by: Oleg Drokin <green@linuxhacker.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ec2d71d083
commit
6f9a3bd93f
|
@ -636,7 +636,7 @@ static int lo_ioctl(struct block_device *bdev, fmode_t mode,
|
||||||
else
|
else
|
||||||
fid_zero(&fid);
|
fid_zero(&fid);
|
||||||
|
|
||||||
if (copy_to_user((struct lu_fid *)arg, &fid, sizeof(fid)))
|
if (copy_to_user((void __user *)arg, &fid, sizeof(fid)))
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -708,7 +708,7 @@ static enum llioc_iter lloop_ioctl(struct inode *unused, struct file *file,
|
||||||
dev = MKDEV(lloop_major, lo->lo_number);
|
dev = MKDEV(lloop_major, lo->lo_number);
|
||||||
|
|
||||||
/* quit if the used pointer is writable */
|
/* quit if the used pointer is writable */
|
||||||
if (put_user((long)old_encode_dev(dev), (long *)arg)) {
|
if (put_user((long)old_encode_dev(dev), (long __user *)arg)) {
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue