All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: linux-btrfs@vger.kernel.org
Cc: kernel-team@fb.com
Subject: [PATCH 7/7] Btrfs: fix __user casting in ioctl.c
Date: Tue, 22 Aug 2017 23:46:05 -0700	[thread overview]
Message-ID: <a59180cb6452c0813ce7d3a86f85a8abcd74d78c.1503470354.git.osandov@fb.com> (raw)
In-Reply-To: <cover.1503470354.git.osandov@fb.com>
In-Reply-To: <cover.1503470354.git.osandov@fb.com>

From: Omar Sandoval <osandov@fb.com>

Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 fs/btrfs/ioctl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index cf71d0304671..7a7a82e0963c 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -2210,7 +2210,7 @@ static noinline int btrfs_ioctl_tree_search_v2(struct file *file,
 
 	inode = file_inode(file);
 	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)))
 		ret = -EFAULT;
 	else if (ret == -EOVERFLOW &&
@@ -4512,8 +4512,8 @@ static long btrfs_ioctl_ino_to_path(struct btrfs_root *root, void __user *arg)
 		ipath->fspath->val[i] = rel_ptr;
 	}
 
-	ret = copy_to_user((void *)(unsigned long)ipa->fspath,
-			   (void *)(unsigned long)ipath->fspath, size);
+	ret = copy_to_user((void __user *)(unsigned long)ipa->fspath,
+			   ipath->fspath, size);
 	if (ret) {
 		ret = -EFAULT;
 		goto out;
@@ -4584,8 +4584,8 @@ static long btrfs_ioctl_logical_to_ino(struct btrfs_fs_info *fs_info,
 	if (ret < 0)
 		goto out;
 
-	ret = copy_to_user((void *)(unsigned long)loi->inodes,
-			   (void *)(unsigned long)inodes, size);
+	ret = copy_to_user((void __user *)(unsigned long)loi->inodes, inodes,
+			   size);
 	if (ret)
 		ret = -EFAULT;
 
-- 
2.14.1


  parent reply	other threads:[~2017-08-23  6:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  6:45 [PATCH 0/7] Btrfs: bugs found by sparse and RCU strings Omar Sandoval
2017-08-23  6:45 ` [PATCH 1/7] Btrfs: fix blk_status_t/errno confusion Omar Sandoval
2017-08-23 15:50   ` David Sterba
2017-08-23 16:13   ` Liu Bo
2017-08-23 19:18     ` Omar Sandoval
2017-08-23  6:46 ` [PATCH 2/7] Btrfs: fix incorrect {node,sector}size endianness from BTRFS_IOC_FS_INFO Omar Sandoval
2017-09-06 14:51   ` David Sterba
2017-08-23  6:46 ` [PATCH 3/7] Move Btrfs RCU string to common library Omar Sandoval
2017-09-06 15:15   ` David Sterba
2017-09-07 17:10     ` Omar Sandoval
2017-08-23  6:46 ` [PATCH 4/7] Btrfs: refactor btrfs_device->name updates Omar Sandoval
2017-08-23  6:46 ` [PATCH 5/7] Btrfs: fix suspicious RCU in BTRFS_IOC_DEV_INFO Omar Sandoval
2017-09-06 15:37   ` David Sterba
2017-09-07 17:24     ` Omar Sandoval
2017-08-23  6:46 ` [PATCH 6/7] Btrfs: make some volumes.c functions static Omar Sandoval
2017-09-06 15:25   ` David Sterba
2017-08-23  6:46 ` Omar Sandoval [this message]
2017-09-06 15:23   ` [PATCH 7/7] Btrfs: fix __user casting in ioctl.c David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a59180cb6452c0813ce7d3a86f85a8abcd74d78c.1503470354.git.osandov@fb.com \
    --to=osandov@osandov.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.