[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 1/2] amd/passthrough: Do not leak domain mappings from do_invalidate_dte()



Coverity ID: 1135379

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CC: Keir Fraser <keir@xxxxxxx>
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Suravee Suthikulpanit <suravee.suthikulpanit@xxxxxxx>
---
 xen/drivers/passthrough/amd/iommu_guest.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/xen/drivers/passthrough/amd/iommu_guest.c 
b/xen/drivers/passthrough/amd/iommu_guest.c
index 952600a..7687cf1 100644
--- a/xen/drivers/passthrough/amd/iommu_guest.c
+++ b/xen/drivers/passthrough/amd/iommu_guest.c
@@ -433,7 +433,10 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t 
*cmd)
 
     /* Do not update host dte before gcr3 has been set */
     if ( gcr3_gfn == 0 )
+    {
+        unmap_domain_page(dte_base);
         return 0;
+    }
 
     gcr3_mfn = mfn_x(get_gfn(d, gcr3_gfn, &p2mt));
     put_gfn(d, gcr3_gfn);
@@ -446,6 +449,7 @@ static int do_invalidate_dte(struct domain *d, cmd_entry_t 
*cmd)
     {
         AMD_IOMMU_DEBUG("%s: Fail to find iommu for bdf %x!\n",
                         __func__, mbdf);
+        unmap_domain_page(dte_base);
         return -ENODEV;
     }
 
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.