Skip to content

Commit a04521a

Browse files
committed
Merge tag 'stable/for-linus-3.8-rc6-tag' of git://git.kernel.org/pub/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}()
2 parents 3227e04 + 68ba45f commit a04521a

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

drivers/xen/events.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ int bind_evtchn_to_irq(unsigned int evtchn)
840840

841841
if (irq == -1) {
842842
irq = xen_allocate_irq_dynamic();
843-
if (irq == -1)
843+
if (irq < 0)
844844
goto out;
845845

846846
irq_set_chip_and_handler_name(irq, &xen_dynamic_chip,
@@ -944,7 +944,7 @@ int bind_virq_to_irq(unsigned int virq, unsigned int cpu)
944944

945945
if (irq == -1) {
946946
irq = xen_allocate_irq_dynamic();
947-
if (irq == -1)
947+
if (irq < 0)
948948
goto out;
949949

950950
irq_set_chip_and_handler_name(irq, &xen_percpu_chip,

drivers/xen/xen-pciback/pciback_ops.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ int xen_pcibk_enable_msi(struct xen_pcibk_device *pdev,
135135
struct pci_dev *dev, struct xen_pci_op *op)
136136
{
137137
struct xen_pcibk_dev_data *dev_data;
138-
int otherend = pdev->xdev->otherend_id;
139138
int status;
140139

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

146145
if (status) {
147-
printk(KERN_ERR "error enable msi for guest %x status %x\n",
148-
otherend, status);
146+
pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI for guest %u: err %d\n",
147+
pci_name(dev), pdev->xdev->otherend_id,
148+
status);
149149
op->value = 0;
150150
return XEN_PCI_ERR_op_failed;
151151
}
@@ -223,10 +223,10 @@ int xen_pcibk_enable_msix(struct xen_pcibk_device *pdev,
223223
pci_name(dev), i,
224224
op->msix_entries[i].vector);
225225
}
226-
} else {
227-
printk(KERN_WARNING DRV_NAME ": %s: failed to enable MSI-X: err %d!\n",
228-
pci_name(dev), result);
229-
}
226+
} else
227+
pr_warn_ratelimited(DRV_NAME ": %s: error enabling MSI-X for guest %u: err %d!\n",
228+
pci_name(dev), pdev->xdev->otherend_id,
229+
result);
230230
kfree(entries);
231231

232232
op->value = result;

0 commit comments

Comments
 (0)