Linux kernel -stable discussions
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] wifi: ath9k: delete channel-context timers on deinit" failed to apply to 5.10-stable tree
@ 2026-11-04 14:24 gregkh
  2026-11-06 22:21 ` Rosen Penev
  0 siblings, 1 reply; 4+ messages in thread
From: gregkh @ 2026-11-04 14:24 UTC (permalink / raw)
  To: rosenp, jeff.johnson, toke; +Cc: stable


The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 81394dfb9a7905472957628b560ae894eae3a30f
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026110443-depth-overbuilt-7852@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'

Possible dependencies:



thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 81394dfb9a7905472957628b560ae894eae3a30f Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Fri, 11 Sep 2026 14:31:44 -0700
Subject: [PATCH] wifi: ath9k: delete channel-context timers on deinit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>

diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 8b27d8cc086a..cfb1c90eb4b6 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -1363,6 +1363,8 @@ void ath9k_init_channel_context(struct ath_softc *sc)
 
 void ath9k_deinit_channel_context(struct ath_softc *sc)
 {
+	timer_shutdown_sync(&sc->sched.timer);
+	timer_shutdown_sync(&sc->offchannel.timer);
 	cancel_work_sync(&sc->chanctx_work);
 }
 


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

* Re: FAILED: patch "[PATCH] wifi: ath9k: delete channel-context timers on deinit" failed to apply to 5.10-stable tree
  2026-11-04 14:24 FAILED: patch "[PATCH] wifi: ath9k: delete channel-context timers on deinit" failed to apply to 5.10-stable tree gregkh
@ 2026-11-06 22:21 ` Rosen Penev
  2026-11-09  0:34   ` Sasha Levin
  0 siblings, 1 reply; 4+ messages in thread
From: Rosen Penev @ 2026-11-06 22:21 UTC (permalink / raw)
  To: gregkh; +Cc: jeff.johnson, toke, stable

On Wed, Nov 4, 2026 at 6:25 AM <gregkh@linuxfoundation.org> wrote:
>
>
> The patch below does not apply to the 5.10-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
>
> To reproduce the conflict and resubmit, you may use the following commands:
>
> git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
> git checkout FETCH_HEAD
> git cherry-pick -x 81394dfb9a7905472957628b560ae894eae3a30f
git cherry-pick -x 81394dfb9a7905472957628b560ae894eae3a30f

works locally. No idea what the issue is here.
> # <resolve conflicts, build, test, etc.>
> git commit -s
> git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026110443-depth-overbuilt-7852@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
>
> Possible dependencies:
>
>
>
> thanks,
>
> greg k-h
>
> ------------------ original commit in Linus's tree ------------------
>
> From 81394dfb9a7905472957628b560ae894eae3a30f Mon Sep 17 00:00:00 2001
> From: Rosen Penev <rosenp@gmail.com>
> Date: Fri, 11 Sep 2026 14:31:44 -0700
> Subject: [PATCH] wifi: ath9k: delete channel-context timers on deinit
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
>
> 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>
>
> diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
> index 8b27d8cc086a..cfb1c90eb4b6 100644
> --- a/drivers/net/wireless/ath/ath9k/channel.c
> +++ b/drivers/net/wireless/ath/ath9k/channel.c
> @@ -1363,6 +1363,8 @@ void ath9k_init_channel_context(struct ath_softc *sc)
>
>  void ath9k_deinit_channel_context(struct ath_softc *sc)
>  {
> +       timer_shutdown_sync(&sc->sched.timer);
> +       timer_shutdown_sync(&sc->offchannel.timer);
>         cancel_work_sync(&sc->chanctx_work);
>  }
>
>

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

* Re: FAILED: patch "[PATCH] wifi: ath9k: delete channel-context timers on deinit" failed to apply to 5.10-stable tree
  2026-11-06 22:21 ` Rosen Penev
@ 2026-11-09  0:34   ` Sasha Levin
  2026-11-09  3:43     ` Rosen Penev
  0 siblings, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2026-11-09  0:34 UTC (permalink / raw)
  To: gregkh; +Cc: Sasha Levin, jeff.johnson, toke, stable, Rosen Penev

> git cherry-pick -x 81394dfb9a7905472957628b560ae894eae3a30f
>
> works locally. No idea what the issue is here.

The cherry-pick applies, but 5.10 has no timer_shutdown_sync() (added in 6.2),
so 81394dfb9a79 ("wifi: ath9k: delete channel-context timers on deinit")
doesn't build there. A 5.10.y patch using del_timer_sync() is welcome.

-- 
Thanks,
Sasha

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

* Re: FAILED: patch "[PATCH] wifi: ath9k: delete channel-context timers on deinit" failed to apply to 5.10-stable tree
  2026-11-09  0:34   ` Sasha Levin
@ 2026-11-09  3:43     ` Rosen Penev
  0 siblings, 0 replies; 4+ messages in thread
From: Rosen Penev @ 2026-11-09  3:43 UTC (permalink / raw)
  To: Sasha Levin; +Cc: gregkh, jeff.johnson, toke, stable

On Sun, Nov 8, 2026 at 4:34 PM Sasha Levin <sashal@kernel.org> wrote:
>
> > git cherry-pick -x 81394dfb9a7905472957628b560ae894eae3a30f
> >
> > works locally. No idea what the issue is here.
>
> The cherry-pick applies, but 5.10 has no timer_shutdown_sync() (added in 6.2),
> so 81394dfb9a79 ("wifi: ath9k: delete channel-context timers on deinit")
> doesn't build there. A 5.10.y patch using del_timer_sync() is welcome.
I assume this gets sent directly to linux-stable.
>
> --
> Thanks,
> Sasha

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

end of thread, other threads:[~2026-11-09  3:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 14:24 FAILED: patch "[PATCH] wifi: ath9k: delete channel-context timers on deinit" failed to apply to 5.10-stable tree gregkh
2026-11-06 22:21 ` Rosen Penev
2026-11-09  0:34   ` Sasha Levin
2026-11-09  3:43     ` Rosen Penev

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