VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   32 Branches   54 Tags
author: Sasha Levin <sasha.levin@oracle.com> 2015-01-28 15:30:43 -0500 committer: Linus Torvalds <torvalds@linux-foundation.org> 2015-06-02 10:29:07 -0700 commit: 161f873b89136eb1e69477c847d5a5033239d9ba parent: f18c34e483ff6b1d9866472221e4015b3a4698e4
Commit Summary:
vfs: read file_handle only once in handle_to_path
Diffstat:
1 file changed, 3 insertions, 2 deletions
diff --git a/fs/fhandle.c b/fs/fhandle.c
index 999ff5c3cab0..d59712dfa3e7 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -195,8 +195,9 @@ static int handle_to_path(int mountdirfd, struct file_handle __user *ufh,
 		goto out_err;
 	}
 	/* copy the full handle */
-	if (copy_from_user(handle, ufh,
-			   sizeof(struct file_handle) +
+	*handle = f_handle;
+	if (copy_from_user(&handle->f_handle,
+			   &ufh->f_handle,
 			   f_handle.handle_bytes)) {
 		retval = -EFAULT;
 		goto out_handle;