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=1795036347; b=5qpoq4guClv9dxOh1zzwm1i+c59OOICNBEJnY2SBdfLnFrWw/M0XmtRKVce9ZBqIo1fG FOXC1wISXEgzgYC0EiuS51USxaU6yPKCX+aaE7HpCvD/QjOmo+oNlQU9IPo9i6Bshpybb rumtyN19h8uU3VhorXmVS29R8vQ+bhapaSgIt9qqmHk8Ofd+PpFvDr/NFeN6d4OzFqsXZ pMvTgrjrGOW/dHh3/4+KmQcqoaIBF5NhwI84spiQe462enDtEM8Qbg/BewGH63uTpzlt8 L1tdvaVTYeXUZy9efubISvgjoBoE0bTOm+FSZvCVvC/D2kzlPfQNo8Avuk/XIefbGCg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795036347; 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=x0etB8Dg5UCZR2hn8zy6xrpMF6+Q7dF/86o7s8Z1yKw=; b=IRGTgKKc7y0PPGV++4HXRMsTHGH1e3nS3kqlrO9AzoKStUfranb11aP9ORkJVJlYhdnb DBzgCtcpTu1yztp8W4ie29tj3Z8/u5yLWeZ7/SzhZXRsusKuHN6Gl2p/EQIh2OOew7EvX oD8rh949wjS7RjlsP70n4J3R0XfLRDtEOkPhw1jSlXv0NI6K+uon/9bnjXwM7YJOIqi5d T7/O5en/DVVSH5K5EHER6+PGWE+WYBshVXXoikj70ih7RMIQY7rcoTw7zWJdLd3CaQch1 nzPu5xJjKFVsB1Bw4GJyqM+NfDHGbbUnpk6ZIIKz4WoJyOOMehGFQ0KC9/YHOkPabUA== 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=NdyioGr8; 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 76700606A325; Wed, 18 Nov 2026 21:12:27 +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=NdyioGr8 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D32101F000C4; Wed, 18 Nov 2026 21:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795036347; bh=x0etB8Dg5UCZR2hn8zy6xrpMF6+Q7dF/86o7s8Z1yKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=NdyioGr8VYMiHYtkme9y2CDPlK1WB5I3TvlGSWjBOcgniqFX+CCNN1zVfvGCDt+sO I5OGf64ALZE4/mp8VII2OZEiN5wAcIlgYqKL3i/Jd6mcwMNyuSvIKKvi5Pz9ccIagd g2fCDkWyNx/TMDAbrOoDrZeKasjOPL9MUY3VfAqk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Orly Orge , Inanix , Mark Anthony Agarro , Devin Wittmayer , Felix Fietkau , Sasha Levin Subject: [PATCH 6.6 1028/3318] wifi: mt76: mt7615: do not tear down BSS/STA state for monitor vifs Date: Wed, 18 Nov 2026 15:27:30 +0100 Message-ID: <20261118150350.725899908@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150313.527275416@linuxfoundation.org> References: <20261118150313.527275416@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mark Anthony Agarro [ Upstream commit f7517b3d8b7f1008e07edcb8bb692c6ca53ef23b ] Tearing down a monitor interface oopses: BUG: kernel NULL pointer dereference, address: 0000000000000000 RIP: 0010:mt76_connac_mcu_uni_add_bss+0x144/0x370 [mt76_connac_lib] Call Trace: mt7615_remove_interface+0x6a/0x200 [mt7615_common] drv_remove_interface+0x60/0x140 [mac80211] ieee80211_del_virtual_monitor+0x8f/0xc0 [mac80211] ieee80211_do_open+0x550/0x7d0 [mac80211] ieee80211_open+0xaa/0xb0 [mac80211] __dev_open+0x11b/0x280 mt7615_remove_interface() tears down BSS and STA state for every vif type. On MT7663 with offload firmware that reaches mt76_connac_mcu_uni_add_bss(), which has no monitor case in its iftype switch. It takes WARN_ON(1), then copies ETH_ALEN from vif->bss_conf.bssid, which is NULL for a monitor vif. mt76_connac_mcu_bss_basic_tlv() in the same file handles this. It has an NL80211_IFTYPE_MONITOR case and it copies phy->macaddr in place of the bssid. The uni variant has neither. There is nothing to tear down. mt7615_add_interface() only calls mt7615_mcu_add_dev_info(). The BSS and STA state comes from beacon enable in mt7615_bss_info_changed(), from mt7615_set_key() and from mt7615_mac_sta_add(), so a monitor vif never has any. Reported on mt7615e going from monitor back to managed, and on mt7663u on an "ip link set down", both through ieee80211_del_virtual_monitor(). Fixes: d9852ab2f362 ("mt76: mt7615: keep mcu_add_bss_info enabled till interface removal") Cc: stable@vger.kernel.org Reported-by: Orly Orge Closes: https://lore.kernel.org/linux-wireless/CANj5C4mTOHs6riyWee=dFdkE5p=714J8xs-x3hq3ewQ+r6O_Nw@mail.gmail.com/ Reported-by: Inanix Closes: https://github.com/morrownr/mt76/issues/79 Tested-by: Inanix Signed-off-by: Mark Anthony Agarro Signed-off-by: Devin Wittmayer Link: https://patch.msgid.link/20260813152059.15747-1-lucid_duck@justthetip.ca Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index c3aa38ea6493d..2b878b1e2a211 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -255,8 +255,10 @@ static void mt7615_remove_interface(struct ieee80211_hw *hw, mt7615_mutex_acquire(dev); - mt7615_mcu_add_bss_info(phy, vif, NULL, false); - mt7615_mcu_sta_add(phy, vif, NULL, false); + if (vif->type != NL80211_IFTYPE_MONITOR) { + mt7615_mcu_add_bss_info(phy, vif, NULL, false); + mt7615_mcu_sta_add(phy, vif, NULL, false); + } mt76_testmode_reset(phy->mt76, true); if (vif == phy->monitor_vif) -- 2.53.0