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 commit 328a146143)
This commit is contained in:
Jan Beulich authored and Andrew Cooper committed 2026-08-26 17:50:14 +01:00
1 parent 54ee7c511a
commit 5dd29d6c94
1 file changed
+6
+6
View File
@@ -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) )
{
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.