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

[Xen-changelog] [xen staging] IOMMU: avoid NULL deref in iommu_lookup_page()



commit 14e122fcc45d8a86e27be9663cbd7bcea1602b25
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Tue May 14 16:22:17 2019 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Tue May 14 16:22:17 2019 +0200

    IOMMU: avoid NULL deref in iommu_lookup_page()
    
    Luckily the function currently has no callers - it would have called
    through NULL for both Arm and x86/AMD.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Paul Durrant <paul.durrant@xxxxxxxxxx>
---
 xen/drivers/passthrough/iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c
index b453b32191..0d2dacf287 100644
--- a/xen/drivers/passthrough/iommu.c
+++ b/xen/drivers/passthrough/iommu.c
@@ -409,7 +409,7 @@ int iommu_lookup_page(struct domain *d, dfn_t dfn, mfn_t 
*mfn,
 {
     const struct domain_iommu *hd = dom_iommu(d);
 
-    if ( !iommu_enabled || !hd->platform_ops )
+    if ( !iommu_enabled || !hd->platform_ops || !hd->platform_ops->lookup_page 
)
         return -EOPNOTSUPP;
 
     return hd->platform_ops->lookup_page(d, dfn, mfn, flags);
--
generated by git-patchbot for /home/xen/git/xen.git#staging

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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