提交 609e3084 编写于 作者: C Chao Yu 提交者: Zheng Zengkai

f2fs: avoid unneeded data copy in f2fs_ioc_move_range()

stable inclusion
from stable-5.10.38
commit 23ecfe7f2c1f399eda6233809f9b8f550f7c7c38
bugzilla: 51875
CVE: NA

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

[ Upstream commit 3a1b9eaf ]

Fields in struct f2fs_move_range won't change in f2fs_ioc_move_range(),
let's avoid copying this structure's data to userspace.
Signed-off-by: NChao Yu <yuchao0@huawei.com>
Reviewed-by: NEric Biggers <ebiggers@google.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 b1e0097d
...@@ -2913,12 +2913,6 @@ static int __f2fs_ioc_move_range(struct file *filp, ...@@ -2913,12 +2913,6 @@ static int __f2fs_ioc_move_range(struct file *filp,
range->pos_out, range->len); range->pos_out, range->len);
mnt_drop_write_file(filp); mnt_drop_write_file(filp);
if (err)
goto err_out;
if (copy_to_user((struct f2fs_move_range __user *)arg,
&range, sizeof(range)))
err = -EFAULT;
err_out: err_out:
fdput(dst); fdput(dst);
return err; return err;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册