Skip to content

Commit

Permalink
Merge tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/tip/tip

Pull irq fix from Borislav Petkov:
 "A single use-after-free fix in the PCI MSI irq domain allocation path"

* tag 'irq_urgent_for_v5.17_rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  PCI/MSI: Prevent UAF in error path
  • Loading branch information
Linus Torvalds committed Jan 23, 2022
2 parents 10c64a0 + a0af3d1 commit ac5a9bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/msi/irqdomain.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ void pci_msi_teardown_msi_irqs(struct pci_dev *dev)
msi_domain_free_irqs_descs_locked(domain, &dev->dev);
else
pci_msi_legacy_teardown_msi_irqs(dev);
msi_free_msi_descs(&dev->dev);
}

/**
Expand Down Expand Up @@ -171,8 +172,7 @@ struct irq_domain *pci_msi_create_irq_domain(struct fwnode_handle *fwnode,
if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
pci_msi_domain_update_chip_ops(info);

info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS |
MSI_FLAG_FREE_MSI_DESCS;
info->flags |= MSI_FLAG_ACTIVATE_EARLY | MSI_FLAG_DEV_SYSFS;
if (IS_ENABLED(CONFIG_GENERIC_IRQ_RESERVATION_MODE))
info->flags |= MSI_FLAG_MUST_REACTIVATE;

Expand Down
1 change: 0 additions & 1 deletion drivers/pci/msi/legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,4 @@ void pci_msi_legacy_teardown_msi_irqs(struct pci_dev *dev)
{
msi_device_destroy_sysfs(&dev->dev);
arch_teardown_msi_irqs(dev);
msi_free_msi_descs(&dev->dev);
}

0 comments on commit ac5a9bb

Please sign in to comment.