From: Dave Jiang <dave.jiang@intel.com>
To: gregkh@linuxfoundation.org
Cc: linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org,
Wenwei Tao <wenwei.tww@alibaba-inc.com>
Subject: Re: [PATCH] uio: fix is_source param for check_copy_size() in copy_to_iter_mcsafe()
Date: Thu, 6 Sep 2018 08:45:58 -0700 [thread overview]
Message-ID: <c81d5d9d-4d9f-917f-d7f5-4d9a4dc6e146@intel.com> (raw)
In-Reply-To: <153617950046.33664.13445188581267552601.stgit@djiang5-desk3.ch.intel.com>
On 09/05/2018 01:31 PM, Dave Jiang wrote:
> 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>
Slight correction:
Reported-by: Wenwei Tao <wenwei.tww@alibaba-inc.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
next prev parent reply other threads:[~2018-09-06 15:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c81d5d9d-4d9f-917f-d7f5-4d9a4dc6e146@intel.com \
--to=dave.jiang@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvdimm@lists.01.org \
--cc=wenwei.tww@alibaba-inc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox