nvdimm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] uio: fix is_source param for check_copy_size() in copy_to_iter_mcsafe()
@ 2018-09-05 20:31 Dave Jiang
  2018-09-06 15:45 ` Dave Jiang
  2018-09-12  7:48 ` Greg KH
  0 siblings, 2 replies; 6+ messages in thread
From: Dave Jiang @ 2018-09-05 20:31 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-nvdimm

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()")

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>
---
 include/linux/uio.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/uio.h b/include/linux/uio.h
index 409c845d4cd3..422b1c01ee0d 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -172,7 +172,7 @@ size_t copy_from_iter_flushcache(void *addr, size_t bytes, struct iov_iter *i)
 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);

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-09-12 22:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-05 20:31 [PATCH] uio: fix is_source param for check_copy_size() in copy_to_iter_mcsafe() Dave Jiang
2018-09-06 15:45 ` Dave Jiang
2018-09-12  7:48 ` Greg KH
2018-09-12 21:51   ` Dan Williams
2018-09-12 21:57     ` Greg KH
2018-09-12 22:02       ` Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).