Skip to content

Commit

Permalink
Merge tag 'stable/for-linus-3.8-rc6-tag' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…scm/linux/kernel/git/konrad/xen

Pull Xen fixes from Konrad Rzeszutek Wilk:
 "This has two fixes.  One is a security fix wherein we would spam the
  kernel printk buffer if one of the guests was misbehaving.  The other
  is much tamer and it was us only checking for one type of error from
  the IRQ subsystem (when allocating new IRQs) instead of for all of
  them.

   - Fix an IRQ allocation where we only check for a specific error (-1).
   - CVE-2013-0231 / XSA-43.  Make xen-pciback rate limit error messages
     from xen_pcibk_enable_msi{,x}()"

* tag 'stable/for-linus-3.8-rc6-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
  xen: fix error handling path if xen_allocate_irq_dynamic fails
  xen-pciback: rate limit error messages from xen_pcibk_enable_msi{,x}()
  • Loading branch information
Linus Torvalds committed Feb 8, 2013
2 parents 3227e04 + 68ba45f commit a04521a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions drivers/xen/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)

if (irq == -1) {
irq = xen_allocate_irq_dynamic();
if (irq == -1)
if (irq < 0)
goto out;

irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
Expand Down Expand Up @@ -944,7 +944,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu)

if (irq == -1) {
irq = xen_allocate_irq_dynamic();
if (irq == -1)
if (irq < 0)
goto out;

irq_set_chip_and_handler_name(irq, &xen_percpu_chip,
Expand Down
14 changes: 7 additions & 7 deletions drivers/xen/xen-pciback/pciback_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
struct pci_dev *dev, struct xen_pci_op *op)
{
struct xen_pcibk_dev_data *dev_data;
int otherend = pdev->xdev->otherend_id;
int status;

if (unlikely(verbose_request))
Expand All @@ -144,8 +143,9 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
status = pci_enable_msi(dev);

if (status) {
printk(KERN_ERR "error enable msi for guest %x status %x\n",
otherend, status);
pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI for guest %u: err %d\n",
pci_name(dev), pdev->xdev->otherend_id,
status);
op->value = 0;
return XEN_PCI_ERR_op_failed;
}
Expand Down Expand Up @@ -223,10 +223,10 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
pci_name(dev), i,
op->msix_entries[i].vector);
}
} else {
printk(KERN_WARNING DRV_NAME ": %s: failed to enable MSI-X: err %d!\n",
pci_name(dev), result);
}
} else
pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI-X for guest %u: err %d!\n",
pci_name(dev), pdev->xdev->otherend_id,
result);
kfree(entries);

op->value = result;
Expand Down

0 comments on commit a04521a

Please sign in to comment.