From: Alexander Lobakin <alobakin@marvell.com>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: Igor Russkikh <irusskikh@marvell.com>,
Michal Kalderon <michal.kalderon@marvell.com>,
Ariel Elior <aelior@marvell.com>,
Yuval Mintz <yuval.mintz@marvell.com>,
Denis Bolotin <denis.bolotin@marvell.com>,
"Ram Amrani" <ram.amrani@marvell.com>,
Tomer Tayar <tomer.tayar@marvell.com>,
Alexander Lobakin <alobakin@marvell.com>,
<GR-everest-linux-l2@marvell.com>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH net 7/9] net: qede: fix use-after-free on recovery and AER handling
Date: Mon, 22 Jun 2020 14:14:11 +0300 [thread overview]
Message-ID: <20200622111413.7006-8-alobakin@marvell.com> (raw)
In-Reply-To: <20200622111413.7006-1-alobakin@marvell.com>
Set edev->cdev pointer to NULL after calling remove() callback to avoid
using of already freed object.
Fixes: ccc67ef50b90 ("qede: Error recovery process")
Signed-off-by: Alexander Lobakin <alobakin@marvell.com>
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@marvell.com>
---
drivers/net/ethernet/qlogic/qede/qede_main.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/qlogic/qede/qede_main.c b/drivers/net/ethernet/qlogic/qede/qede_main.c
index f6ff31e73ebe..29e285430f99 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_main.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_main.c
@@ -1318,6 +1318,7 @@ static void __qede_remove(struct pci_dev *pdev, enum qede_remove_mode mode)
if (system_state == SYSTEM_POWER_OFF)
return;
qed_ops->common->remove(cdev);
+ edev->cdev = NULL;
/* Since this can happen out-of-sync with other flows,
* don't release the netdevice until after slowpath stop
--
2.21.0
next prev parent reply other threads:[~2020-06-22 11:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-22 11:14 [PATCH net 0/9] net: qed/qede: various stability fixes Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 1/9] net: qed: fix left elements count calculation Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 2/9] net: qed: fix async event callbacks unregistering Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 3/9] net: qede: stop adding events on an already destroyed workqueue Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 4/9] net: qed: fix NVMe login fails over VFs Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 5/9] net: qed: fix excessive QM ILT lines consumption Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 6/9] net: qede: fix PTP initialization on recovery Alexander Lobakin
2020-06-22 11:14 ` Alexander Lobakin [this message]
2020-06-22 11:14 ` [PATCH net 8/9] net: qed: reset ILT block sizes before recomputing to fix crashes Alexander Lobakin
2020-06-22 11:14 ` [PATCH net 9/9] net: qed: fix "maybe uninitialized" warning Alexander Lobakin
2020-06-22 21:44 ` Jakub Kicinski
2020-06-23 12:16 ` Alexander Lobakin
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=20200622111413.7006-8-alobakin@marvell.com \
--to=alobakin@marvell.com \
--cc=GR-everest-linux-l2@marvell.com \
--cc=aelior@marvell.com \
--cc=davem@davemloft.net \
--cc=denis.bolotin@marvell.com \
--cc=irusskikh@marvell.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.kalderon@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=ram.amrani@marvell.com \
--cc=tomer.tayar@marvell.com \
--cc=yuval.mintz@marvell.com \
/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
all inboxes | Powered by JetHome®