mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] wifi: ath9k: kill WMI event tasklet before freeing wmi
Date: Fri, 02 Oct 2026 16:03:22 -0700	[thread overview]
Message-ID: <6ac0383a.9ad129c8.3858c0.0008.GAE@google.com> (raw)
In-Reply-To: <6abfe679.b50370da.302ea9.000d.GAE@google.com>

For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: [PATCH] wifi: ath9k: kill WMI event tasklet before freeing wmi
Author: kartikey406@gmail.com

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


The device becomes visible to the HTC/WMI RX path before
ath9k_htc_probe_device() has finished. If probe fails, the error path
stops WMI and kills the RX URBs, but ath9k_destroy_wmi() then frees
struct wmi while wmi_event_tasklet may still be scheduled from an event
that arrived earlier. tasklet_action_common() later walks the softirq
list and reads the freed tasklet, causing a slab-use-after-free.

Call tasklet_kill() and purge wmi_event_queue before kfree(). Callers
already set wmi->stopped and kill the RX URBs first, so the tasklet
cannot be re-armed after this point.

Reported-by: syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=e91dc13b1b37759b3d9f
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 drivers/net/wireless/ath/ath9k/wmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/ath/ath9k/wmi.c b/drivers/net/wireless/ath/ath9k/wmi.c
index 4a08babb6d9d..a629de91015b 100644
--- a/drivers/net/wireless/ath/ath9k/wmi.c
+++ b/drivers/net/wireless/ath/ath9k/wmi.c
@@ -122,6 +122,9 @@ void ath9k_stop_wmi(struct ath9k_htc_priv *priv)
 
 void ath9k_destroy_wmi(struct ath9k_htc_priv *priv)
 {
+	struct wmi *wmi = priv->wmi;
+	tasklet_kill(&wmi->wmi_event_tasklet);
+	skb_queue_purge(&wmi->wmi_event_queue);
 	kfree(priv->wmi);
 }
 
-- 
2.43.0


  reply	other threads:[~2026-10-02 23:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-02 17:14 [syzbot] [wireless?] KASAN: slab-use-after-free Read in tasklet_action_common syzbot
2026-10-02 23:03 ` syzbot [this message]
2026-10-02 23:09 ` Forwarded: [PATCH] wifi: ath9k: stop WMI event tasklet from rescheduling itself on probe failure syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ac0383a.9ad129c8.3858c0.0008.GAE@google.com \
    --to=syzbot+e91dc13b1b37759b3d9f@syzkaller.appspotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®