[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181002132509.570370249@linuxfoundation.org>
Date: Tue, 2 Oct 2018 06:24:14 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org, Fan Du <fan.du@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Wenwei Tao <wenwei.tww@...baba-inc.com>,
Dan Williams <dan.j.williams@...el.com>
Subject: [PATCH 4.18 157/228] uaccess: Fix is_source param for check_copy_size() in copy_to_iter_mcsafe()
4.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Jiang <dave.jiang@...el.com>
commit dfb06cba8c73c0704710b2e3fbe2c35ac66a01b4 upstream.
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: 8780356ef630 ("x86/asm/memcpy_mcsafe: Define copy_to_iter_mcsafe()")
Cc: <stable@...r.kernel.org>
Reported-by: Fan Du <fan.du@...el.com>
Signed-off-by: Dave Jiang <dave.jiang@...el.com>
Reviewed-by: Vishal Verma <vishal.l.verma@...el.com>
Reported-by: Wenwei Tao <wenwei.tww@...baba-inc.com>
Signed-off-by: Dan Williams <dan.j.williams@...el.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
include/linux/uio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -172,7 +172,7 @@ size_t copy_from_iter_flushcache(void *a
static __always_inline __must_check
size_t copy_to_iter_mcsafe(void *addr, size_t bytes, struct iov_iter *i)
{
- if (unlikely(!check_copy_size(addr, bytes, false)))
+ if (unlikely(!check_copy_size(addr, bytes, true)))
return 0;
else
return _copy_to_iter_mcsafe(addr, bytes, i);
Powered by blists - more mailing lists