[PATCH] x86/IRQ: constrain creator-domain-ID assertion

Jan Beulich posted 1 patch 7 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/9fc0b9d1-15e5-47e9-a532-a25e1ac32ba2@suse.com
[PATCH] x86/IRQ: constrain creator-domain-ID assertion
Posted by Jan Beulich 7 months, 1 week ago
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")
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/arch/x86/irq.c
+++ b/xen/arch/x86/irq.c
@@ -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)
     {

Re: [PATCH] x86/IRQ: constrain creator-domain-ID assertion
Posted by Roger Pau Monné 7 months, 1 week ago
On Wed, May 14, 2025 at 09:22:54AM +0200, Jan Beulich wrote:
> 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")
> Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

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

Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Thanks, Roger.