* [PATCH 5.10] wifi: ath9k: delete channel-context timers on deinit
@ 2026-12-01 15:20 Alexander Martyniuk
0 siblings, 0 replies; only message in thread
From: Alexander Martyniuk @ 2026-12-01 15:20 UTC (permalink / raw)
To: stable, Greg Kroah-Hartman
Cc: Alexander Martyniuk, lvc-project, QCA ath9k Development,
Kalle Valo, David S. Miller, Jakub Kicinski, Sujith Manoharan,
John W. Linville, linux-wireless, netdev, linux-kernel,
Rosen Penev, Toke Høiland-Jørgensen, Jeff Johnson
From: Rosen Penev <rosenp@gmail.com>
commit 81394dfb9a7905472957628b560ae894eae3a30f upstream.
ath9k_deinit_channel_context() cancels chanctx_work but does not delete
the offchannel and sched timers set up by ath9k_init_channel_context().
If either timer fires after deinit (e.g. during driver unload or
suspend), it accesses sc->sc_ah which may already be freed by
ath9k_hw_deinit(), causing a use-after-free.
Delete both timers with timer_shutdown_sync() before cancelling the work
item.
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Toke Høiland-Jørgensen <toke@toke.dk>
Cc: stable@vger.kernel.org # v6.2+
Fixes: 705d0bf83dbe ("ath9k: Add a routine for initializing channel contexts")
Link: https://patch.msgid.link/20260911213144.130192-1-rosenp@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
[Alexander: del_timer_sync() used instead of the timer_shutdown_sync()]
Signed-off-by: Alexander Martyniuk <alexevgmart@gmail.com>
---
Backport fix for COMMIT_81394dfb
drivers/net/wireless/ath/ath9k/channel.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 31b7921bf34f..d05565ac480d 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1368,6 +1368,8 @@ void ath9k_init_channel_context(struct ath_softc *sc)
void ath9k_deinit_channel_context(struct ath_softc *sc)
{
+ del_timer_sync(&sc->sched.timer);
+ del_timer_sync(&sc->offchannel.timer);
cancel_work_sync(&sc->chanctx_work);
}
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-12-01 15:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 15:20 [PATCH 5.10] wifi: ath9k: delete channel-context timers on deinit Alexander Martyniuk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox