[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200623135136.3185-8-alobakin@marvell.com>
Date: Tue, 23 Jun 2020 16:51:35 +0300
From: Alexander Lobakin <alobakin@...vell.com>
To: "David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
CC: Igor Russkikh <irusskikh@...vell.com>,
Michal Kalderon <michal.kalderon@...vell.com>,
Ariel Elior <aelior@...vell.com>,
"Denis Bolotin" <denis.bolotin@...vell.com>,
Tomer Tayar <tomer.tayar@...vell.com>,
Alexander Lobakin <alobakin@...vell.com>,
<GR-everest-linux-l2@...vell.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: [PATCH v2 net 7/9] net: qede: fix use-after-free on recovery and AER handling
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@...vell.com>
Signed-off-by: Igor Russkikh <irusskikh@...vell.com>
Signed-off-by: Michal Kalderon <michal.kalderon@...vell.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.25.1
Powered by blists - more mailing lists