]> xenbits.xensource.com Git - xen.git/commitdiff
x86/FLASK: fix unmap-domain-IRQ XSM hook
authorJan Beulich <jbeulich@suse.com>
Thu, 12 Oct 2017 13:58:52 +0000 (15:58 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 12 Oct 2017 13:58:52 +0000 (15:58 +0200)
The caller and the FLASK implementation of xsm_unmap_domain_irq()
disagreed about what the "data" argument points to in the MSI case:
Change both sides to pass/take a PCI device.

This is part of XSA-237.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 6f17f5c43a3bd28d27ed8133b2bf513e2eab7d59
master date: 2017-10-12 14:37:56 +0200

xen/arch/x86/irq.c
xen/xsm/flask/hooks.c

index d59afb3b67ee7d10babda41ba3abd819a9222eb9..98a7b607200c66d3cbddf481f0de9e88d07ff064 100644 (file)
@@ -2141,7 +2141,8 @@ int unmap_domain_pirq(struct domain *d, int pirq)
         nr = msi_desc->msi.nvec;
     }
 
-    ret = xsm_unmap_domain_irq(XSM_HOOK, d, irq, msi_desc);
+    ret = xsm_unmap_domain_irq(XSM_HOOK, d, irq,
+                               msi_desc ? msi_desc->dev : NULL);
     if ( ret )
         goto done;
 
index d48463ffb8e47ce79cbb48d4f327f04f8443190f..809d8271fe85e254eb4e241b8fb7731ce14ec220 100644 (file)
@@ -884,8 +884,8 @@ static int flask_unmap_domain_msi (struct domain *d, int irq, void *data,
                                    u32 *sid, struct avc_audit_data *ad)
 {
 #ifdef HAS_PCI
-    struct msi_info *msi = data;
-    u32 machine_bdf = (msi->seg << 16) | (msi->bus << 8) | msi->devfn;
+    const struct pci_dev *pdev = data;
+    u32 machine_bdf = (pdev->seg << 16) | (pdev->bus << 8) | pdev->devfn;
 
     AVC_AUDIT_DATA_INIT(ad, DEV);
     ad->device = machine_bdf;