Skip to content

Commit dfb06cb

Browse files
davejiangdjbw
authored andcommitted
uaccess: Fix is_source param for check_copy_size() in copy_to_iter_mcsafe()
copy_to_iter_mcsafe() is passing in the is_source parameter as "false" to check_copy_size(). This is different than what copy_to_iter() does. Also, the addr parameter passed to check_copy_size() is the source so therefore we should be passing in "true" instead. Fixes: 8780356 ("x86/asm/memcpy_mcsafe: Define copy_to_iter_mcsafe()") Cc: <stable@vger.kernel.org> Reported-by: Fan Du <fan.du@intel.com> Signed-off-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Vishal Verma <vishal.l.verma@intel.com> Reported-by: Wenwei Tao <wenwei.tww@alibaba-inc.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent b90ca5c commit dfb06cb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/uio.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ size_t copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i)
172172
static __always_inline __must_check
173173
size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i)
174174
{
175-
if (unlikely(!check_copy_size(addr, bytes, false)))
175+
if (unlikely(!check_copy_size(addr, bytes, true)))
176176
return 0;
177177
else
178178
return _copy_to_iter_mcsafe(addr, bytes, i);

0 commit comments

Comments
 (0)