Patchwork [3.11,192/208] Btrfs: fix access_ok() check in btrfs_ioctl_send()

login
register
mail settings
Submitter Luis Henriques
Date Dec. 19, 2013, 11:54 a.m.
Message ID <1387454106-19326-193-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/303411/
State New
Headers show

Comments

Luis Henriques - Dec. 19, 2013, 11:54 a.m.
3.11.10.2 -stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 700ff4f095d78af0998953e922e041d75254518b upstream.

The closing parenthesis is in the wrong place.  We want to check
"sizeof(*arg->clone_sources) * arg->clone_sources_count" instead of
"sizeof(*arg->clone_sources * arg->clone_sources_count)".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Jie Liu <jeff.liu@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/send.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 0c87c6b..d4c34c8 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -4613,8 +4613,8 @@  long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
 	}
 
 	if (!access_ok(VERIFY_READ, arg->clone_sources,
-			sizeof(*arg->clone_sources *
-			arg->clone_sources_count))) {
+			sizeof(*arg->clone_sources) *
+			arg->clone_sources_count)) {
 		ret = -EFAULT;
 		goto out;
 	}