x86/vMsi-x: check whether msixtbl_list in msixtbl_pt_register()
PATCH 1/1 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.
--- xen/arch/x86/hvm/vmsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/hvm/vmsi.c +1 -1
@@ -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 ;/*
Signature · 7 lines
1.8.3.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 10 lines · Chao Gao
MSI-x tables' initializtion had been deferred in the commit
74c6dc2d0ac4dcab0c6243cdf6ed550c1532b798. If an assigned device does not support MSI-x, themsixtbl_listwon't be initialized. However, the following paths
XEN_DOMCTL_bind_pt_irq
pt_irq_create_bind
msixtbl_pt_register
do not check this case. Someerrors(malwares, etc.)may lead to callingXEN_DOMCTL_bind_pt_irqwithout a clear gtable and will cause Xen panic.Signed-off-by Chao Gao <[email protected]>
Quoted 9 lines
--- xen/arch/x86/hvm/vmsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)xen/arch/x86/hvm/vmsi.c +0
-0
xen/arch/x86/hvm/vmsi.c int msixtbl_pt_register(struct domain *d, struct pirq *pirq, uint64_t gtable) · line 465
Quoted 8 lines
xen/arch/x86/hvm/vmsi.c +1
-1@@ -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 ;/*
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel