Commit 718dc5fa authored by Omar Sandoval's avatar Omar Sandoval Committed by David Sterba

Btrfs: fix __user casting in ioctl.c

Signed-off-by: default avatarOmar Sandoval <osandov@fb.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c9162bdf
...@@ -2164,7 +2164,7 @@ static noinline int btrfs_ioctl_tree_search_v2(struct file *file, ...@@ -2164,7 +2164,7 @@ static noinline int btrfs_ioctl_tree_search_v2(struct file *file,
inode = file_inode(file); inode = file_inode(file);
ret = search_ioctl(inode, &args.key, &buf_size, ret = search_ioctl(inode, &args.key, &buf_size,
(char *)(&uarg->buf[0])); (char __user *)(&uarg->buf[0]));
if (ret == 0 && copy_to_user(&uarg->key, &args.key, sizeof(args.key))) if (ret == 0 && copy_to_user(&uarg->key, &args.key, sizeof(args.key)))
ret = -EFAULT; ret = -EFAULT;
else if (ret == -EOVERFLOW && else if (ret == -EOVERFLOW &&
...@@ -4489,8 +4489,8 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg) ...@@ -4489,8 +4489,8 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg)
ipath->fspath->val[i] = rel_ptr; ipath->fspath->val[i] = rel_ptr;
} }
ret = copy_to_user((void *)(unsigned long)ipa->fspath, ret = copy_to_user((void __user *)(unsigned long)ipa->fspath,
(void *)(unsigned long)ipath->fspath, size); ipath->fspath, size);
if (ret) { if (ret) {
ret = -EFAULT; ret = -EFAULT;
goto out; goto out;
...@@ -4561,8 +4561,8 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info, ...@@ -4561,8 +4561,8 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
if (ret < 0) if (ret < 0)
goto out; goto out;
ret = copy_to_user((void *)(unsigned long)loi->inodes, ret = copy_to_user((void __user *)(unsigned long)loi->inodes, inodes,
(void *)(unsigned long)inodes, size); size);
if (ret) if (ret)
ret = -EFAULT; ret = -EFAULT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment