x86/FLASK: fix unmap-domain-IRQ XSM hook
authorJan Beulich <jbeulich@suse.com>
Thu, 12 Oct 2017 12:37:56 +0000 (14:37 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 12 Oct 2017 12:37:56 +0000 (14:37 +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>
xen/arch/x86/irq.c
xen/xsm/flask/hooks.c

index 94c1267cef32f11e2ac85569c84e2307e03e09c5..c0ab2992ee277a612a712afdca5bdd0b85332988 100644 (file)
@@ -2154,7 +2154,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 7b005af83460b460acd8b7ebdd387eb94633c5a1..f01b4cfaaa2bf2ee386b3c6dfa469ec1923bbeda 100644 (file)
@@ -947,8 +947,8 @@ static int flask_unmap_domain_msi (struct domain *d, int irq, void *data,
                                    u32 *sid, struct avc_audit_data *ad)
 {
 #ifdef CONFIG_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;