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=1795019130; b=VO5rXVVGHwAeZHUzpzWpuqShPv9/aUI06k/lBqXrdi7++tJsgwf7AWkz1qLpXtSlLCTN 9TsbHxerUdSjibCzwhI13g+MDTqnaS+UYkz8AaBOKzBF+3W1NUxjX/Na2bNdUVst0DBbh hvhAfNqfWG1jAKlUkBvfi9Fl+H8wqNUzKJZ6LusJ8/dCeDE2ItPOcIxy/ndrbSHHHSrC1 0USpGd6zXwJdr+qFz1B+hkOJiljbwLX+15GeWtTXkU1XguYJwKEVeZAheRCI5F1ROdiUv uNGl7hbfhqGf2E2hCDZiFdg9kUE9FrE+bk7yCF4pKkxGBkoifMB0U3ICK3p6e5KIlfw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795019130; 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=3WRzmemYlypGekVAGs+fz/vnvApRWuu6VBcpAVGdAjc=; b=r00e9B2CJ+Q5eBvcKulhJpeptWc55rmmkgVzooLr2flUnv4Svi57rvxG91u8U0HGnOaB DMoaSDBznQdXDI5nY8VCQGrXt/aHLWbx2u9Vhub1RHww7dRtdNaRPkvw5tAm+6Yvx70Gd +6RwnNh6ktJNkfdgu9riuNUG3kZAIfuNdPRLR9dsmK4IziHOaOBbTWEQL4+yWtAICvNB0 uVsbkmFvu/XKVlVfhZsxUbu8UPInaCx+hi7vgDMGZcEDwBWf+xxQc3o4WjhBoad/n0pJr 32SJwYnSETSm93VIVFY/ZJ0YghKcmrmx0J9TfoZH3QATvUBAAQby2axiC4JN4Zo22lQ== 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=Z9pBmWLb; 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 58360606A325; Wed, 18 Nov 2026 16:25:30 +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=Z9pBmWLb Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E9DB1F000C4; Wed, 18 Nov 2026 16:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795019130; bh=3WRzmemYlypGekVAGs+fz/vnvApRWuu6VBcpAVGdAjc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Z9pBmWLbim0pcJLdwkHi96GrOUbSLirlW9ixTe6aEhzXkKoCFxqLxOM7qgO1gzRE7 VCoCrWCzo+6gbGk3O0UnyQRQisRQhSbOGBMwT6DKvw/cQx9PDQNx21pyAUzi4OF3tX SSxotB0pjl7lTj5JXiw0FduGPjtvgVqLBPc+m8OA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ryan Leung , Felix Fietkau , Sasha Levin Subject: [PATCH 7.3 1444/2651] wifi: mt76: fix wcid teardown ordering in mt76_reset_device() Date: Wed, 18 Nov 2026 15:44:44 +0100 Message-ID: <20261118150340.029912872@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150247.972732815@linuxfoundation.org> References: <20261118150247.972732815@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ryan Leung [ Upstream commit 5cebbd7a87df834efe002c8e54211e6adc99703a ] mt76_reset_device() tears down each wcid's pktid idr before clearing dev->wcid[i], which is the reverse of the ordering used on the sta removal path. Until the pointer is cleared, a concurrent lookup under status_lock can still find the wcid and access its already destroyed idr. Clear dev->wcid[i] before calling mt76_wcid_cleanup(), reproducing the ordering mac80211 already enforces for normal sta removal (where mt76_sta_pre_rcu_remove() clears dev->wcid[idx] before mt76_wcid_cleanup() runs via the .sta_state callback). Fixes: 065c79df595a ("wifi: mt76: mt7915: fix list corruption after hardware restart") Signed-off-by: Ryan Leung Link: https://patch.msgid.link/20260821-mt76-wcid-null-before-cleanup-v1-1-0e364d9062d6@protonmail.com Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index ab037e302dca8..16b435b96d99b 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -856,8 +856,8 @@ void mt76_reset_device(struct mt76_dev *dev) continue; wcid->sta = 0; - mt76_wcid_cleanup(dev, wcid); rcu_assign_pointer(dev->wcid[i], NULL); + mt76_wcid_cleanup(dev, wcid); } rcu_read_unlock(); -- 2.53.0