patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/1] net/txgbe: fix use-after-free on remove
@ 2023-05-18  7:11 Yunjian Wang
  2023-05-18  7:46 ` Jiawen Wu
  0 siblings, 1 reply; 3+ messages in thread
From: Yunjian Wang @ 2023-05-18  7:11 UTC (permalink / raw)
  To: dev; +Cc: jiawenwu, jianwang, luyicai, Yunjian Wang, stable

When cleaning up NIC's interrupts, it is possible to add some alarms
at the same time. However, if these alarms are not canceled, it may
cause use-after-free problems. Therefore, after cleaning up NIC's
interrupts, these alarms should also be canceled.

Fixes: d3bb4a04eac1 ("net/txgbe: add SFP hotplug identification")
Fixes: e0d876ef6bbc ("net/txgbe: support device stop and close")
Cc: stable@dpdk.org

Reported-by: Pengfei Sun <sunpengfei16@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/txgbe/txgbe_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/txgbe/txgbe_ethdev.c b/drivers/net/txgbe/txgbe_ethdev.c
index a502618bc5..a3d7461951 100644
--- a/drivers/net/txgbe/txgbe_ethdev.c
+++ b/drivers/net/txgbe/txgbe_ethdev.c
@@ -2032,8 +2032,10 @@ txgbe_dev_close(struct rte_eth_dev *dev)
 		rte_delay_ms(100);
 	} while (retries++ < (10 + TXGBE_LINK_UP_TIME));
 
-	/* cancel the delay handler before remove dev */
+	/* cancel all alarm handler before remove dev */
 	rte_eal_alarm_cancel(txgbe_dev_interrupt_delayed_handler, dev);
+	rte_eal_alarm_cancel(txgbe_dev_detect_sfp, dev);
+	rte_eal_alarm_cancel(txgbe_dev_setup_link_alarm_handler, dev);
 
 	/* uninitialize PF if max_vfs not zero */
 	txgbe_pf_host_uninit(dev);
-- 
2.33.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-18 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-18  7:11 [dpdk-dev] [PATCH 1/1] net/txgbe: fix use-after-free on remove Yunjian Wang
2023-05-18  7:46 ` Jiawen Wu
2023-05-18 17:49   ` Ferruh Yigit

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).