From: Paul Durrant <Paul.Durrant@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH 1/2] x86/hvm/dmop: fix EFAULT condition
Date: Thu, 28 Sep 2017 10:28:55 +0000 [thread overview]
Message-ID: <903c305aa1454be1800f45cf06cb2ae3@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <20170928102425.22745-2-wei.liu2@citrix.com>
> -----Original Message-----
> From: Wei Liu [mailto:wei.liu2@citrix.com]
> Sent: 28 September 2017 11:24
> To: Xen-devel <xen-devel@lists.xenproject.org>
> Cc: Wei Liu <wei.liu2@citrix.com>; Jan Beulich <jbeulich@suse.com>;
> Andrew Cooper <Andrew.Cooper3@citrix.com>; Paul Durrant
> <Paul.Durrant@citrix.com>
> Subject: [PATCH 1/2] x86/hvm/dmop: fix EFAULT condition
>
> The copy macro returns false when the copy fails.
>
> Signed-off-by: Wei Liu <wei.liu2@citrix.com>
> ---
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Paul Durrant <paul.durrant@citrix.com>
>
> Backport to 4.9
> ---
> xen/arch/x86/hvm/dm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xen/arch/x86/hvm/dm.c b/xen/arch/x86/hvm/dm.c
> index 87ef4b6ca9..b1cf0d54a2 100644
> --- a/xen/arch/x86/hvm/dm.c
> +++ b/xen/arch/x86/hvm/dm.c
> @@ -182,7 +182,7 @@ static int modified_memory(struct domain *d,
>
> rc = COPY_FROM_GUEST_BUF_OFFSET(extent,
> bufs, EXTENTS_BUFFER, (*rem_extents - 1) * sizeof(extent));
> - if ( rc )
> + if ( !rc )
> return -EFAULT;
For clarity and consistency I think it would be better to avoid use of rc in this case and simply put the call to COPY_FROM_GUEST_BUF_OFFSET() inside the if clause.
Paul
>
> if ( extent.pad )
> --
> 2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-09-28 10:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-28 10:24 [PATCH 0/2] Fix bugs in dmop code Wei Liu
2017-09-28 10:24 ` [PATCH 1/2] x86/hvm/dmop: fix EFAULT condition Wei Liu
2017-09-28 10:28 ` Paul Durrant [this message]
2017-09-28 10:24 ` [PATCH 2/2] libxendevicemodel: initialise extent to zero Wei Liu
2017-09-28 10:31 ` Paul Durrant
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=903c305aa1454be1800f45cf06cb2ae3@AMSPEX02CL03.citrite.net \
--to=paul.durrant@citrix.com \
--cc=Andrew.Cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/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;
as well as URLs for NNTP newsgroup(s).