* FAILED: patch "[PATCH] wifi: mac80211: drain link readers before stopping removed" failed to apply to 6.1-stable tree
@ 2026-11-25 10:32 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2026-11-25 10:32 UTC (permalink / raw)
To: enderaoelyther, johannes.berg; +Cc: stable
The patch below does not apply to the 6.1-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-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 745f5d04395dfc4c311f443c7c04ccb00c436984
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026112508-leverage-contents-d7bd@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 745f5d04395dfc4c311f443c7c04ccb00c436984 Mon Sep 17 00:00:00 2001
From: Zhao Li <enderaoelyther@gmail.com>
Date: Wed, 28 Oct 2026 22:17:08 +0800
Subject: [PATCH] wifi: mac80211: drain link readers before stopping removed
links
Removing an MLO link can leave work queued on its link container after
the container is freed.
ieee80211_tear_down_links() stops each link before the RCU grace period.
A reader that fetched the link earlier can therefore queue work after
ieee80211_link_stop() has canceled it. ieee80211_request_smps() and
ieee80211_csa_finish() can both reach this window.
Record each removed link while removing its keys and debugfs state. Wait
for RCU readers, then stop the recorded links so cancellation includes
work queued by those readers. Free the detached keys after the grace
period as before.
LLM assistance was used to find the bug and review.
Fixes: efe9c2bfd1a8 ("wifi: mac80211: isolate driver from inactive links")
Cc: stable@vger.kernel.org
Signed-off-by: Zhao Li <enderaoelyther@gmail.com>
Link: https://patch.msgid.link/20261028141708.5532-1-enderaoelyther@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
diff --git a/net/mac80211/link.c b/net/mac80211/link.c
index 34d313a2fef3..957ab9d232a9 100644
--- a/net/mac80211/link.c
+++ b/net/mac80211/link.c
@@ -192,6 +192,7 @@ struct link_container {
static void ieee80211_tear_down_links(struct ieee80211_sub_if_data *sdata,
struct link_container **links, u16 mask)
{
+ struct ieee80211_link_data *stop[IEEE80211_MLD_MAX_NUM_LINKS] = {};
struct ieee80211_link_data *link;
LIST_HEAD(keys);
unsigned int link_id;
@@ -206,11 +207,16 @@ static void ieee80211_tear_down_links(struct ieee80211_sub_if_data *sdata,
continue;
ieee80211_remove_link_keys(link, &keys);
ieee80211_link_debugfs_remove(link);
- ieee80211_link_stop(link);
+ stop[link_id] = link;
}
+ /* drain RCU readers before cancelling work they may queue */
synchronize_rcu();
+ for (link_id = 0; link_id < IEEE80211_MLD_MAX_NUM_LINKS; link_id++)
+ if (stop[link_id])
+ ieee80211_link_stop(stop[link_id]);
+
ieee80211_free_key_list(sdata->local, &keys);
}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-25 10:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 10:32 FAILED: patch "[PATCH] wifi: mac80211: drain link readers before stopping removed" failed to apply to 6.1-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox