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

[Xen-changelog] [xen master] x86/vMSI-x: check whether msixtbl_list in msixtbl_pt_register()



commit 6d61981d3619c6bad6134c2dac9774c00acca4fd
Author:     Chao Gao <chao.gao@xxxxxxxxx>
AuthorDate: Mon Aug 1 18:22:54 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 1 18:22:54 2016 +0200

    x86/vMSI-x: check whether msixtbl_list in msixtbl_pt_register()
    
    MSI-x tables' initializtion had been deferred in the commit
    74c6dc2d0ac4dcab0c6243cdf6ed550c1532b798. If an assigned device does not 
support
    MSI-x, the msixtbl_list won't be initialized. However, the following paths
        XEN_DOMCTL_bind_pt_irq
        pt_irq_create_bind
            msixtbl_pt_register
    do not check this case. Some errors(malwares, etc.) may lead to calling
    XEN_DOMCTL_bind_pt_irq without a clear gtable and will cause Xen panic.
    
    Signed-off-by: Chao Gao <chao.gao@xxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/hvm/vmsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c
index ef1dfff..d81c5d4 100644
--- a/xen/arch/x86/hvm/vmsi.c
+++ b/xen/arch/x86/hvm/vmsi.c
@@ -459,7 +459,7 @@ int msixtbl_pt_register(struct domain *d, struct pirq 
*pirq, uint64_t gtable)
     ASSERT(pcidevs_locked());
     ASSERT(spin_is_locked(&d->event_lock));
 
-    if ( !has_vlapic(d) )
+    if ( !msixtbl_initialised(d) )
         return -ENODEV;
 
     /*
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
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®.