提交 bdc7abec 编写于 作者: C Christoph Hellwig 提交者: Zheng Zengkai

iov_iter: fix the uaccess area in copy_compat_iovec_from_user

stable inclusion
from stable-5.10.11
commit 37d4f78ae274d11c26eb7deb912f8fdf12bd2283
bugzilla: 47621

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

[ Upstream commit a959a978 ]

sizeof needs to be called on the compat pointer, not the native one.

Fixes: 89cd35c5 ("iov_iter: transparently handle compat iovecs in import_iovec")
Reported-by: NDavid Laight <David.Laight@ACULAB.COM>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 2d58fce6
......@@ -1658,7 +1658,7 @@ static int copy_compat_iovec_from_user(struct iovec *iov,
(const struct compat_iovec __user *)uvec;
int ret = -EFAULT, i;
if (!user_access_begin(uvec, nr_segs * sizeof(*uvec)))
if (!user_access_begin(uiov, nr_segs * sizeof(*uiov)))
return -EFAULT;
for (i = 0; i < nr_segs; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册