xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <paul.durrant@citrix.com>
To: xen-devel@lists.xen.org
Cc: Paul Durrant <paul.durrant@citrix.com>,
	Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>
Subject: [PATCH v5 1/9] hvm_set_ioreq_page() releases wrong page in error path
Date: Thu, 1 May 2014 13:08:32 +0100	[thread overview]
Message-ID: <1398946120-33169-2-git-send-email-paul.durrant@citrix.com> (raw)
In-Reply-To: <1398946120-33169-1-git-send-email-paul.durrant@citrix.com>

The function calls prepare_ring_for_helper() to acquire a mapping for the
given gmfn, then checks (under lock) to see if the ioreq page is already
set up but, if it is, the function then releases the in-use ioreq page
mapping on the error path rather than the one it just acquired. This patch
fixes this bug.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Keir Fraser <keir@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
---
 xen/arch/x86/hvm/hvm.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index ac05160..3dec1eb 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -496,7 +496,7 @@ static int hvm_set_ioreq_page(
 
     if ( (iorp->va != NULL) || d->is_dying )
     {
-        destroy_ring_for_helper(&iorp->va, iorp->page);
+        destroy_ring_for_helper(&va, page);
         spin_unlock(&iorp->lock);
         return -EINVAL;
     }
-- 
1.7.10.4

  reply	other threads:[~2014-05-01 12:08 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-01 12:08 [PATCH v5 0/9] Support for running secondary emulators Paul Durrant
2014-05-01 12:08 ` Paul Durrant [this message]
2014-05-01 12:48   ` [PATCH v5 1/9] hvm_set_ioreq_page() releases wrong page in error path Andrew Cooper
2014-05-01 12:08 ` [PATCH v5 2/9] ioreq-server: pre-series tidy up Paul Durrant
2014-05-06 12:25   ` Jan Beulich
2014-05-06 12:37     ` Paul Durrant
2014-05-01 12:08 ` [PATCH v5 3/9] ioreq-server: centralize access to ioreq structures Paul Durrant
2014-05-06 12:35   ` Jan Beulich
2014-05-06 12:41     ` Paul Durrant
2014-05-06 14:13       ` Paul Durrant
2014-05-06 14:21         ` Jan Beulich
2014-05-06 14:32           ` Paul Durrant
2014-05-06 14:39             ` Jan Beulich
2014-05-01 12:08 ` [PATCH v5 4/9] ioreq-server: create basic ioreq server abstraction Paul Durrant
2014-05-06 12:55   ` Jan Beulich
2014-05-06 13:12     ` Paul Durrant
2014-05-06 13:24       ` Jan Beulich
2014-05-06 13:40         ` Paul Durrant
2014-05-06 13:50           ` Jan Beulich
2014-05-06 13:44         ` Paul Durrant
2014-05-06 13:51           ` Jan Beulich
2014-05-06 13:53             ` Paul Durrant
2014-05-01 12:08 ` [PATCH v5 5/9] ioreq-server: on-demand creation of ioreq server Paul Durrant
2014-05-06 14:18   ` Jan Beulich
2014-05-06 14:24     ` Paul Durrant
2014-05-06 15:07       ` Jan Beulich
2014-05-01 12:08 ` [PATCH v5 6/9] ioreq-server: add support for multiple servers Paul Durrant
2014-05-06 10:46   ` Ian Campbell
2014-05-06 13:28     ` Paul Durrant
2014-05-07  9:44       ` Ian Campbell
2014-05-07  9:48         ` Paul Durrant
2014-05-07 11:13   ` Jan Beulich
2014-05-07 12:06     ` Paul Durrant
2014-05-07 12:23       ` Jan Beulich
2014-05-07 12:25         ` Paul Durrant
2014-05-07 12:34           ` Jan Beulich
2014-05-07 12:37             ` Paul Durrant
2014-05-07 14:07               ` Jan Beulich
2014-05-07 14:12                 ` Paul Durrant
2014-05-07 14:22                   ` Jan Beulich
2014-05-01 12:08 ` [PATCH v5 7/9] ioreq-server: remove p2m entries when server is enabled Paul Durrant
2014-05-06 10:48   ` Ian Campbell
2014-05-06 16:57     ` Paul Durrant
2014-05-07 12:09   ` Jan Beulich
2014-05-01 12:08 ` [PATCH v5 8/9] ioreq-server: make buffered ioreq handling optional Paul Durrant
2014-05-06 10:52   ` Ian Campbell
2014-05-06 13:17     ` Paul Durrant
2014-05-07 12:13   ` Jan Beulich
2014-05-01 12:08 ` [PATCH v5 9/9] ioreq-server: bring the PCI hotplug controller implementation into Xen Paul Durrant
2014-05-06 11:24   ` Ian Campbell
2014-05-06 13:02     ` Paul Durrant
2014-05-06 13:24       ` Ian Campbell
2014-05-06 13:35         ` Paul Durrant
2014-05-07  9:48           ` Ian Campbell
2014-05-07  9:51             ` Paul Durrant
2014-05-07 14:41 ` [PATCH v5 0/9] Support for running secondary emulators Jan Beulich
2014-05-07 14:45   ` 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=1398946120-33169-2-git-send-email-paul.durrant@citrix.com \
    --to=paul.durrant@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=xen-devel@lists.xen.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).