From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] VT-d: fix two map_domain_page() leaks Date: Thu, 16 Dec 2010 15:38:46 +0000 Message-ID: <4D0A409602000078000286C0@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part8BA7C196.1__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" Cc: ZhouPeng List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part8BA7C196.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich Tested-by: ZhouPeng --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1331,6 +1331,7 @@ int domain_context_mapping_one( if ( context_set_domain_id(context, domain, iommu) ) { spin_unlock(&iommu->lock); + unmap_vtd_domain_page(context_entries); return -EFAULT; } =20 @@ -1672,6 +1673,7 @@ static int intel_iommu_map_page( if ( old.val =3D=3D new.val ) { spin_unlock(&hd->mapping_lock); + unmap_vtd_domain_page(page); return 0; } *pte =3D new; --=__Part8BA7C196.1__= Content-Type: text/plain; name="vtd-map-page-leak.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vtd-map-page-leak.patch" Signed-off-by: Jan Beulich =0ATested-by: ZhouPeng = =0A=0A--- a/xen/drivers/passthrough/vtd/iommu.c=0A+++ = b/xen/drivers/passthrough/vtd/iommu.c=0A@@ -1331,6 +1331,7 @@ int = domain_context_mapping_one(=0A if ( context_set_domain_id(context, = domain, iommu) )=0A {=0A spin_unlock(&iommu->lock);=0A+ = unmap_vtd_domain_page(context_entries);=0A return -EFAULT;=0A = }=0A =0A@@ -1672,6 +1673,7 @@ static int intel_iommu_map_page(=0A if ( = old.val =3D=3D new.val )=0A {=0A spin_unlock(&hd->mapping_lock)= ;=0A+ unmap_vtd_domain_page(page);=0A return 0;=0A }=0A = *pte =3D new;=0A --=__Part8BA7C196.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part8BA7C196.1__=--