From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796385506; b=UuW4ZALGYHDr5MVO+sPfqMl7WLSu/+pFe/OXTg22Y0kl7AcOxeuKd/aMcEKB5WCLRtLQ P97FYRsuZR9UUcQk/S7Lw13q+e4m6s4abwmbgh+gb5zhh2FwRhSVRFCoIGqmqn5oFMj/W j53ARRmSchQF7Hm133ZvqUczsvdvxw1TG6LmuiCrJ5JFstYz/rcz7wHvmBLVAfm1XHwZo vMf/YjBmlQbgeBf8wVxeJbPYNWUYqeIxVvJctLLbP4mQJ91Zn0MkzGcrT7Ldr7tWvtjmZ ltkEXrlGfiRCN1V3PGop+4maoiADDGrUFr7hRVvJR12Ac44+ci4IOpFsh6HdTTNbTcA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385506; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=XL+6ChJGJDg34kSf+H5xYuJyz5bVQBus1wY16J3DoWg=; b=D4clmbqaJ/SPItFXzKx5BkpiaGjFwGsM4Js6cKR9Nfh6vjGgqDUh7Ob6W4iqWfZp1vX7 V6AQUI1zY/n07mlrBTy9T363EbP1CpyWb1VH2FT7euTt4ZoL8YaSHFpnZy6ijVUyUyma5 2sXgb3TZnht2fyO8PPbwyrMBiqE5gzgZwvC28Sq8vPIQe56sYLSBGdGUq5LTvBYKhS3so DCNQCAqQbHgDjKiPkkEzneSpSyK8/Yvem0o1WI1ZfqmDCxQmzdpCAYJKEwPod//GJtg1S yvUVZgSyVyci2XaTc/Lq6usGRjhu/Mg4yabA2wo1DUvW4dUn2o7+6pqv7QUj23PpJEw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="EEbwN/zh"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7230606A330; Fri, 4 Dec 2026 11:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=EEbwN/zh Received: by smtp.kernel.org (Postfix) with ESMTPSA id D6FA41F00A0E; Fri, 4 Dec 2026 11:58:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385505; bh=XL+6ChJGJDg34kSf+H5xYuJyz5bVQBus1wY16J3DoWg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=EEbwN/zhlaCaScmEGsj5fGF00fu3LyQmYGgdDag+WTKbnlcc87yqf/BK7w05ILNN0 L9HNtmBBMrMkcZfCqTo/Gx0TMo7S1doOOOx5N16Yl/+hQtrhT0aOXQc2HsSqXVUgxy zSpWb8T1hi30RtuuMM3fihB7hoVc6jMq3ysGXulY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zhao Li , Johannes Berg Subject: [PATCH 6.6 0579/1167] wifi: mac80211: drain link readers before stopping removed links Date: Fri, 4 Dec 2026 19:00:06 +0900 Message-ID: <20261204100717.133802305@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zhao Li commit 745f5d04395dfc4c311f443c7c04ccb00c436984 upstream. 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 Link: https://patch.msgid.link/20261028141708.5532-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/link.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -95,6 +95,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; @@ -109,11 +110,16 @@ static void ieee80211_tear_down_links(st 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); }