From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Daley Subject: [PATCH] xen: fix domain unlocking in some xsm error paths Date: Thu, 28 Feb 2013 15:05:45 +1300 Message-ID: <1362017145-8046-1-git-send-email-mattjd@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Matthew Daley List-Id: xen-devel@lists.xenproject.org A couple of xsm error/access-denied code paths in hypercalls neglect to unlock a previously locked domain. Fix by ensuring the domains are unlocked correctly. Signed-off-by: Matthew Daley --- xen/arch/x86/physdev.c | 2 +- xen/common/grant_table.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index d9ed5df..3006266 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -111,7 +111,7 @@ int physdev_map_pirq(domid_t domid, int type, int *index, int *pirq_p, ret = xsm_map_domain_pirq(XSM_TARGET, d); if ( ret ) - return ret; + goto free_domain; /* Verify or get irq. */ switch ( type ) diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index f85adb4..5bd99b8 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -2283,7 +2283,7 @@ gnttab_get_status_frames(XEN_GUEST_HANDLE_PARAM(gnttab_get_status_frames_t) uop, rc = xsm_grant_setup(XSM_TARGET, current->domain, d); if ( rc ) { op.status = GNTST_permission_denied; - goto out1; + goto out2; } gt = d->grant_table; -- 1.7.10.4