dmaengine.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] dmaengine: idxd: Remove improper idxd_free
@ 2025-05-29 15:34 Yi Sun
  2025-05-29 15:34 ` [PATCH 2/2] dmaengine: idxd: Fix refcount underflow on module unload Yi Sun
  2025-05-29 16:56 ` [PATCH 1/2] dmaengine: idxd: Remove improper idxd_free Vinicius Costa Gomes
  0 siblings, 2 replies; 10+ messages in thread
From: Yi Sun @ 2025-05-29 15:34 UTC (permalink / raw)
  To: dave.jiang, vinicius.gomes, dmaengine, linux-kernel
  Cc: yi.sun, xueshuai, gordon.jin

The put_device() call can be asynchronous cleanup via schedule_delayed_work
when CONFIG_DEBUG_KOBJECT_RELEASE is set. This results in a use-after-free
failure during module unloading if invoking idxd_free() immediately
afterward.

Removes the improper call idxd_free() to prevent potential memory
corruption.

Signed-off-by: Yi Sun <yi.sun@intel.com>

diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 760b7d81fcd8..504aca0fd597 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -1324,7 +1324,6 @@ static void idxd_remove(struct pci_dev *pdev)
 	idxd_cleanup(idxd);
 	pci_iounmap(pdev, idxd->reg_base);
 	put_device(idxd_confdev(idxd));
-	idxd_free(idxd);
 	pci_disable_device(pdev);
 }
 
-- 
2.43.0


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

end of thread, other threads:[~2025-05-30  5:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29 15:34 [PATCH 1/2] dmaengine: idxd: Remove improper idxd_free Yi Sun
2025-05-29 15:34 ` [PATCH 2/2] dmaengine: idxd: Fix refcount underflow on module unload Yi Sun
2025-05-29 17:04   ` Vinicius Costa Gomes
2025-05-30  3:06     ` Yi Sun
2025-05-30  5:39       ` Shuai Xue
2025-05-30  5:58         ` Yi Sun
2025-05-29 16:56 ` [PATCH 1/2] dmaengine: idxd: Remove improper idxd_free Vinicius Costa Gomes
2025-05-30  0:24   ` Yi Sun
2025-05-30  1:07     ` Vinicius Costa Gomes
2025-05-30  1:42       ` Yi Sun

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