diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-02-06 19:30:38 +0400 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2013-03-06 07:24:19 +0400 |
commit | ecb1d58c0722e593e50317a63294a52ac2308ace (patch) | |
tree | 2878cbcd37c9f4912b7cb82c36d299c86d2bb242 /drivers/xen | |
parent | f20a819cc8b7335f2714950ff7638d52fcd50fdc (diff) | |
download | linux-ecb1d58c0722e593e50317a63294a52ac2308ace.tar.xz |
xen-pciback: rate limit error messages from xen_pcibk_enable_msi{,x}()
commit 51ac8893a7a51b196501164e645583bf78138699 upstream.
... as being guest triggerable (e.g. by invoking
XEN_PCI_OP_enable_msi{,x} on a device not being MSI/MSI-X capable).
This is CVE-2013-0231 / XSA-43.
Also make the two messages uniform in both their wording and severity.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[bwh: Backported to 3.2: add #include <linux/ratelimited.h>, needed by
printk_ratelimited()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'drivers/xen')
-rw-r--r-- | drivers/xen/xen-pciback/pciback_ops.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/xen/xen-pciback/pciback_ops.c b/drivers/xen/xen-pciback/pciback_ops.c index 63616d7453e6..d07c4cdcb76e 100644 --- a/drivers/xen/xen-pciback/pciback_ops.c +++ b/drivers/xen/xen-pciback/pciback_ops.c @@ -8,6 +8,7 @@ #include <linux/bitops.h> #include <xen/events.h> #include <linux/sched.h> +#include <linux/ratelimit.h> #include "pciback.h" int verbose_request; @@ -135,7 +136,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)) @@ -144,8 +144,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; } @@ -223,10 +224,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; |