From: Bimmy Pujari <bimmy.pujari@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] [next PATCH S52-V2 01/15] i40evf: check for msix_entries null dereference
Date: Tue, 8 Nov 2016 13:05:05 -0800 [thread overview]
Message-ID: <1478639119-14656-2-git-send-email-bimmy.pujari@intel.com> (raw)
In-Reply-To: <1478639119-14656-1-git-send-email-bimmy.pujari@intel.com>
From: Alan Brady <alan.brady@intel.com>
It is possible for msix_entries to be freed by a previous suspend/remove
before a VF is closed. This patch fixes the issue by checking for NULL
before dereferencing msix_entries and returning early in the case where
it is NULL within the i40evf_close code path. Without this patch it is
possible to trigger a kernel panic through NULL dereference.
Signed-off-by: Alan Brady <alan.brady@intel.com>
Change-ID: I92a2746e82533a889e25f91578eac9abd0388ae2
---
Testing-hints:
Create lots of VFs and bring themm up on the host, assign them and
the PF to namespaces, then shut the system down.
drivers/net/ethernet/intel/i40evf/i40evf_main.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index f04ac36..420e545 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -631,6 +631,9 @@ static void i40evf_free_traffic_irqs(struct i40evf_adapter *adapter)
{
int vector, irq_num, q_vectors;
+ if (!adapter->msix_entries)
+ return;
+
q_vectors = adapter->num_msix_vectors - NONQ_VECS;
for (vector = 0; vector < q_vectors; vector++) {
@@ -1443,6 +1446,9 @@ static void i40evf_free_q_vectors(struct i40evf_adapter *adapter)
**/
void i40evf_reset_interrupt_capability(struct i40evf_adapter *adapter)
{
+ if (!adapter->msix_entries)
+ return;
+
pci_disable_msix(adapter->pdev);
kfree(adapter->msix_entries);
adapter->msix_entries = NULL;
--
2.4.11
next prev parent reply other threads:[~2016-11-08 21:05 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-08 21:05 [Intel-wired-lan] [next PATCH S52-V2 00/15] i40e/i40evf updates Bimmy Pujari
2016-11-08 21:05 ` Bimmy Pujari [this message]
2016-11-16 18:56 ` [Intel-wired-lan] [next PATCH S52-V2 01/15] i40evf: check for msix_entries null dereference Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 02/15] i40e: Remove unreachable code Bimmy Pujari
2016-11-16 18:58 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 03/15] i40e: Pass unknown PHY type for unknown PHYs Bimmy Pujari
2016-11-16 19:21 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 04/15] i40evf: protect against NULL msix_entries and q_vectors pointers Bimmy Pujari
2016-11-16 19:24 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 05/15] i40e: Fix for ethtool Supported link modes Bimmy Pujari
2016-11-16 19:27 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 06/15] i40e: set broadcast promiscuous mode for each active VLAN Bimmy Pujari
2016-11-21 21:17 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 07/15] i40e/i40evf: replace for memcpy with single memcpy call in ethtool Bimmy Pujari
2016-11-16 20:34 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 08/15] i40e: change message to only appear when extra debug info is wanted Bimmy Pujari
2016-11-16 20:39 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 09/15] i40e: Driver prints log message on link speed change Bimmy Pujari
2016-11-16 23:51 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 10/15] i40e: simplify txd use count calculation Bimmy Pujari
2016-11-17 18:06 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 11/15] i40e: restore workaround for removing default MAC filter Bimmy Pujari
2016-11-17 18:11 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 12/15] i40e/i40evf: napi_poll must return the work done Bimmy Pujari
2016-11-17 18:27 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 13/15] i40e: remove code to handle dev_addr specially Bimmy Pujari
2016-11-17 18:33 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 14/15] i40e: Blink LED on 1G BaseT boards Bimmy Pujari
2016-11-21 20:00 ` Bowers, AndrewX
2016-11-08 21:05 ` [Intel-wired-lan] [next PATCH S52-V2 15/15] Changed version from 1.6.21 to 1.6.25 Bimmy Pujari
2016-11-17 18:36 ` Bowers, AndrewX
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=1478639119-14656-2-git-send-email-bimmy.pujari@intel.com \
--to=bimmy.pujari@intel.com \
--cc=intel-wired-lan@osuosl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.