From: <gregkh@linuxfoundation.org>
To: JBeulich@suse.com, bhelgaas@google.com,
gregkh@linuxfoundation.org, hch@lst.de, jbeulich@suse.com,
tglx@linutronix.de
Cc: <stable@vger.kernel.org>, <stable-commits@vger.kernel.org>
Subject: Patch "PCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity()" has been added to the 4.9-stable tree
Date: Mon, 09 Jan 2017 16:27:29 +0100 [thread overview]
Message-ID: <148397564918176@kroah.com> (raw)
This is a note to let you know that I've just added the patch titled
PCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity()
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
pci-msi-check-for-null-affinity-mask-in-pci_irq_get_affinity.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From d1d111e073840b8dbc1ae90ba3fc274736451bdc Mon Sep 17 00:00:00 2001
From: Jan Beulich <JBeulich@suse.com>
Date: Tue, 8 Nov 2016 00:43:54 -0700
Subject: PCI/MSI: Check for NULL affinity mask in pci_irq_get_affinity()
From: Jan Beulich <JBeulich@suse.com>
commit d1d111e073840b8dbc1ae90ba3fc274736451bdc upstream.
If msi_setup_entry() fails to allocate an affinity mask, it logs a message
but continues on and allocates an MSI entry with entry->affinity == NULL.
Check for this case in pci_irq_get_affinity() so we don't try to
dereference a NULL pointer.
[bhelgaas: changelog]
Fixes: ee8d41e53efe "pci/msi: Retrieve affinity for a vector"
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
CC: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/pci/msi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -1294,7 +1294,8 @@ const struct cpumask *pci_irq_get_affini
} else if (dev->msi_enabled) {
struct msi_desc *entry = first_pci_msi_entry(dev);
- if (WARN_ON_ONCE(!entry || nr >= entry->nvec_used))
+ if (WARN_ON_ONCE(!entry || !entry->affinity ||
+ nr >= entry->nvec_used))
return NULL;
return &entry->affinity[nr];
Patches currently in stable-queue which might be from JBeulich@suse.com are
queue-4.9/pci-msi-check-for-null-affinity-mask-in-pci_irq_get_affinity.patch
reply other threads:[~2017-01-09 15:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=148397564918176@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=JBeulich@suse.com \
--cc=bhelgaas@google.com \
--cc=hch@lst.de \
--cc=stable-commits@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).