Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown
@ 2026-06-14 11:47 Ayush Mukkanwar
  2026-06-14 11:47 ` [PATCH 2/2] staging: octeon: add missing napi_disable in cvm_oct_rx_shutdown Ayush Mukkanwar
  2026-06-15  8:18 ` [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Ayush Mukkanwar @ 2026-06-14 11:47 UTC (permalink / raw)
  To: gregkh
  Cc: linux-staging, linux-kernel, linux-kernel-mentees, skhan,
	Ayush Mukkanwar

The TX cleanup tasklet can be scheduled by the watchdog IRQ handler
to execute cvm_oct_tx_do_cleanup. There can be a pending tasklet in
the queue which might run after the cvm_oct_remove() frees net_device
structures, causing a use-after-free in cvm_oct_tx_do_cleanup() as it
iterates cvm_oct_device[] which is an array of netdevice pointers.
Add tasklet_kill() after free_irq() to ensure the tasklet is no longer
scheduled or running before teardown proceeds.

Signed-off-by: Ayush Mukkanwar <ayushmukkanwar@gmail.com>
---
 drivers/staging/octeon/ethernet-tx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index 14d10659bce7..785c6492f170 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -668,4 +668,6 @@ void cvm_oct_tx_shutdown(void)
 {
 	/* Free the interrupt handler */
 	free_irq(OCTEON_IRQ_TIMER1, cvm_oct_device);
+
+	tasklet_kill(&cvm_oct_tx_cleanup_tasklet);
 }
-- 
2.54.0


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

end of thread, other threads:[~2026-06-15  9:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-14 11:47 [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown Ayush Mukkanwar
2026-06-14 11:47 ` [PATCH 2/2] staging: octeon: add missing napi_disable in cvm_oct_rx_shutdown Ayush Mukkanwar
2026-06-15  8:18 ` [PATCH 1/2] staging: octeon: add missing tasklet_kill in cvm_oct_tx_shutdown Dan Carpenter
2026-06-15  9:08   ` Ayush Mukkanwar
2026-06-15  9:10     ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox