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=1796385503; b=PiaKgut3ajqKonB36CAH04NOL2wpxTHQEsu8NJ6+oNnocDmxImDyvrDqmZQ2aQGlQnK0 71oU/1ldoiY20a/K5T3PnbzMqQUlSt+t4KAK5JIS3HIrwDb6fmqRa+NTGQNf2uvQc9s0w AJ4xXc89cdCG9PiBwR/0UGr8s4JGVqbU0qznbIfwuNAwrjMRf0dWXYP5FINCAMwr0BqR1 oMdqezWCuNCpwZMdKFCfX5VHmK+nonROpOzDQ5043jTIu/4jefRJJ+64riXDG+kg41SA5 e2X1q79IhqDgq/QMyU1ckvDPOW4pqo9vucNO7l/3qnAzSaerVESN686fbV+wqoVaD6A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385503; 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=kuOr74dT3s2EbCADeDd7kIUs2EJ0DEPL6X74joVM++I=; b=czbyGcoUbUO1/PVFUKX2YIXvCsMQxAmJS1xWTNPqD7z9+pKAsCrJbivLNxfi9Ek8CzGZ 0ktA0dKAMrA260rhpnTAVFbDUxADK2fWfdOrF97AdAw42sFMQOGwT+rvclEieLEtQLBgI UxLCg7TqI5fMFeq/mTaZ29SHqwO9J+mtjQPjjTGQJVmTC4xQ9avxT91NL3ZSXDUYvhgUD UVjiVrYiPKQ6+xgK4vt6LZKw9qyfhH0/hp9HqNInQYNEtFcPVd6zwm/dQ/Mq1MrbemXlM 0K+9GavR1bhDGFOUId1vd4NgP0I05P2ZrT8XXTsjbHQXIV9QYQhkMyCi/J8eSL+iadw== 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=c1mOg52b; 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 17CFD606A322; Fri, 4 Dec 2026 11:58:22 +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=c1mOg52b Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CF341F00A3F; Fri, 4 Dec 2026 11:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385502; bh=kuOr74dT3s2EbCADeDd7kIUs2EJ0DEPL6X74joVM++I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=c1mOg52bzAsGJeJWHle58Anv6xBW8zsWNO2gLL1mVXcw57VOiCUTe3QsjOHclG+vV rhLM0oXjRzBspe4KgUE669XJvU8iokpeV18XmXbQDUVHotdw4lhPjSdJoNDRmw+4Rx l+7bNCTgeXslofrOTd5/gKJfXiL6tNuR7N68RaXM= 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 0578/1167] wifi: mac80211: fix use-after-free when MLO link setup is rolled back Date: Fri, 4 Dec 2026 19:00:05 +0900 Message-ID: <20261204100717.107172604@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 a155ef2ef79531c139244289c5b8f15c05d16a0e upstream. Rolling back an MLO link addition can free link containers while RCU readers still hold pointers to them. ieee80211_vif_update_links() publishes new links before checking for duplicate addresses and calling drv_change_vif_links(). If either fails, it restores the old pointers and frees the new containers without waiting for readers. During a non-MLO to MLO transition, the published link 0 replaces the deflink, so existing link 0 users can acquire the new container. Readers such as ieee80211_csa_finish() and ieee80211_obss_color_collision_notify() can also queue work embedded in the link. If they queue after ieee80211_link_stop() cancels that work, it remains queued when the container is freed. Wait for RCU readers after restoring the old pointers and before stopping the new links, so their work is queued before it is cancelled. Fixes: d3e2439b0f33 ("wifi: mac80211: fix link manipulation") Cc: stable@vger.kernel.org # 7.2.x Signed-off-by: Zhao Li Link: https://patch.msgid.link/20261026152654.80697-1-enderaoelyther@gmail.com Signed-off-by: Johannes Berg Signed-off-by: Greg Kroah-Hartman --- net/mac80211/link.c | 2 ++ 1 file changed, 2 insertions(+) --- a/net/mac80211/link.c +++ b/net/mac80211/link.c @@ -282,6 +282,8 @@ static int ieee80211_vif_update_links(st memcpy(sdata->link, old_data, sizeof(old_data)); memcpy(sdata->vif.link_conf, old, sizeof(old)); ieee80211_set_vif_links_bitmaps(sdata, old_links, dormant_links); + /* drain RCU readers before cancelling work they may queue */ + synchronize_rcu(); for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) { ieee80211_link_debugfs_remove(&links[link_id]->data); ieee80211_link_stop(&links[link_id]->data);