Skip to contentSkip to conversation

x86/IRQ: constrain creator-domain-ID assertion

PATCH In review Jan Beulich 2 participants 2 messages May 14, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/IRQ: constrain creator-domain-ID assertion

If init_one_irq_desc() fails, ->arch.creator_domid won't be set to the expected value, and hence the assertion may trigger. Limit it to just the success case of that function call.

Fixes 92d9101eab ("x86: allow stubdom access to irq created for msi")
xen/arch/x86/irq.c +2 -2
@@ -289,9 +289,9 @@ int create_irq(nodeid_t node, bool grant
                 mask = NULL;
         }
         ret = assign_irq_vector(irq, mask);
-    }
 
-    ASSERT(desc->arch.creator_domid == DOMID_INVALID);
+        ASSERT(desc->arch.creator_domid == DOMID_INVALID);
+    }
 
     if (ret < 0)
     {
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jan Beulich

If init_one_irq_desc() fails, ->arch.creator_domid won't be set to the expected value, and hence the assertion may trigger. Limit it to just the success case of that function call.

Fixes 92d9101eab ("x86: allow stubdom access to irq created for msi")

Hm, the logic in that function is convoluted to say the least.

Thanks, Roger.