mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
x86/pass-through: disallow pt_irq_create_bind() on dying domains
DMs may invoke XEN_DOMCTL_bind_pt_irq for domains already under destruction. When XEN_DOMCTL_bind_pt_irq is invoked after pci_release_devices() (invoked from underneath domain_kill()) had already completed, it would allocate hvm_domain_irq(d)->dpci anew, without that ever being freed during subsequent domain cleanup. Leverage evtchn_destroy()'s kind-of-spin-barrier, allowing to simply check ->is_dying with the domain's event lock held. This is XSA-509 / CVE-2026-62437. Fixes:7a26b541a2("vtd: Dynamically allocate IRQ-tracking structures, only for those") Signed-off-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com> (cherry picked from commit328a146143)
This commit is contained in:
1 parent
54ee7c511a
commit
5dd29d6c94
1 file changed
+6
@@ -231,6 +231,12 @@ int pt_irq_create_bind(
|
||||
restart:
|
||||
write_lock(&d->event_lock);
|
||||
|
||||
if ( d->is_dying )
|
||||
{
|
||||
write_unlock(&d->event_lock);
|
||||
return -ESRCH;
|
||||
}
|
||||
|
||||
hvm_irq_dpci = domain_get_irq_dpci(d);
|
||||
if ( !hvm_irq_dpci && !is_hardware_domain(d) )
|
||||
{
|
||||
|
||||