mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: syzbot <syzbot+f5752cd6b94fe38be666@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] wifi: mac80211: mesh: free pending CSA settings on interface stop
Date: Sun, 23 Aug 2026 19:42:45 -0700	[thread overview]
Message-ID: <6a8bafa5.dbb3a75c.13dd47.005b.GAE@google.com> (raw)
In-Reply-To: <6a8b254b.91706f20.16b6e3.02c9.GAE@google.com>

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

***

Subject: [PATCH] wifi: mac80211: mesh: free pending CSA settings on interface stop
Author: kartikey406@gmail.com

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


ifmsh->csa is allocated in ieee80211_mesh_csa_beacon() and normally
freed in ieee80211_mesh_finish_csa() once the channel switch
completes. If the mesh interface is stopped while a channel switch
is still in progress, ifmsh->csa is never freed, leaking the
mesh_csa_settings object.

Free it in ieee80211_stop_mesh(), the same way ifmsh->beacon is
already handled there.

Reported-by: syzbot+f5752cd6b94fe38be666@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f5752cd6b94fe38be666
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
---
 net/mac80211/mesh.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index d4507e4e6ec1..d3fb4478a366 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -1201,7 +1201,8 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 	struct ieee80211_local *local = sdata->local;
 	struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
 	struct beacon_data *bcn;
-
+	struct mesh_csa_settings *csa;
+ 
 	netif_carrier_off(sdata->dev);
 
 	/* flush STAs and mpaths on this iface */
@@ -1222,6 +1223,13 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
 	RCU_INIT_POINTER(ifmsh->beacon, NULL);
 	kfree_rcu(bcn, rcu_head);
 
+	/* free any pending, unfinished channel switch */
+	csa = sdata_dereference(ifmsh->csa, sdata);
+	if (csa) {
+		RCU_INIT_POINTER(ifmsh->csa, NULL);
+		kfree_rcu(csa, rcu_head);
+	}
+
 	/* free all potentially still buffered group-addressed frames */
 	local->total_ps_buffered -= skb_queue_len(&ifmsh->ps.bc_buf);
 	skb_queue_purge(&ifmsh->ps.bc_buf);
-- 
2.34.1


      reply	other threads:[~2026-08-24  2:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23 16:52 [syzbot] [wireless?] memory leak in ieee80211_mesh_csa_beacon syzbot
2026-08-24  2:42 ` syzbot [this message]

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=6a8bafa5.dbb3a75c.13dd47.005b.GAE@google.com \
    --to=syzbot+f5752cd6b94fe38be666@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®