[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <25459896a398909d195fd5eb3d82ca1acb07b783.1615381467.git.christophe.leroy@csgroup.eu>
Date: Wed, 10 Mar 2021 13:08:31 +0000 (UTC)
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Alexander Viro <viro@...iv.linux.org.uk>
Cc: linux-kernel@...r.kernel.org
Subject: [PATCH] iov_iter: Use user_read_access_begin() instead of
user_access_begin()
copy_compat_iovec_from_user() only do unsafe_get_user(),
it only requires read access.
Signed-off-by: Christophe Leroy <christophe.leroy@...roup.eu>
---
lib/iov_iter.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/iov_iter.c b/lib/iov_iter.c
index f66c62aa7154..76952a117b47 100644
--- a/lib/iov_iter.c
+++ b/lib/iov_iter.c
@@ -1665,7 +1665,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(uiov, nr_segs * sizeof(*uiov)))
+ if (!user_read_access_begin(uiov, nr_segs * sizeof(*uiov)))
return -EFAULT;
for (i = 0; i < nr_segs; i++) {
@@ -1686,7 +1686,7 @@ static int copy_compat_iovec_from_user(struct iovec *iov,
ret = 0;
uaccess_end:
- user_access_end();
+ user_read_access_end();
return ret;
}
--
2.25.0
Powered by blists - more mailing lists