From nobody Wed Oct 15 22:39:52 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BBB8E175574; Sun, 24 Mar 2024 23:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323378; cv=none; b=Kx5xD5fIcVzg3T3WHae7CTJ06AcCMQtykYNP8PruM/ZYp8ko7poSx9trzIdSscOPL3khDEJV8aOflVbp4UTo+a11kfG/DqWSBoij0I1wR/pY5P/oldHoZ49JqgSdP3Npo3QN/CWIH6ZhO0zG/4as0AwxFhWxSJxM26+vsLhLW7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323378; c=relaxed/simple; bh=bUp9gv8F2HXyH3Sx38pQGTGmmV2F7SvXCa8AF74hBJY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M69bcTocT80P5whcCiRG6oYnBfquMjBnIibb6XNjqB4t2HLbOHA4odaBDb+dWwaXkwUmVDfThZbnCEOHCZVy73GZGDia400enr7Lus4HEJ9JyJeWkHItCoeq1a+/OPq0MyR3IXnRo4zkCaeDWdgcazF552Ufe11QiJa49anxZQo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YwzEhWdQ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YwzEhWdQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEE3EC433F1; Sun, 24 Mar 2024 23:36:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323377; bh=bUp9gv8F2HXyH3Sx38pQGTGmmV2F7SvXCa8AF74hBJY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YwzEhWdQ6k7BjOSq4ZPB7nXMPRASYEdHTXsuJ1PNoTgtiXeP+in4xzkFBxZl8PVzD 2xBbLQxm+SXM6ExGUo79iuhdmbWXKJP5HGESKW4uejkvISwfQuN/0PR+LCNqd20tjM 2SI9ZucZwyjk1hdBlx+3HKjX7Q6Feo95775Uuw52ACrdoVcrtQRjB8cdhbOaE32XiQ swLRmibwBcYWQEN9Y6sgA+pEhchIP3P0zmN4369EYVQ6OkRRL48bYOjWU+PAilB0ih 0/o3XJyO0h2XXb15JTXpWjI56cOwgGa04YiNVZFyTNABl7mKlZgPn+kv9djDcMIqJH 4IWyFgdYXQrUw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Johannes Berg , Andrei Otcheretianski , Gregory Greenman , Miri Korenblit , Sasha Levin Subject: [PATCH 5.15 077/317] wifi: iwlwifi: mvm: report beacon protection failures Date: Sun, 24 Mar 2024 19:30:57 -0400 Message-ID: <20240324233458.1352854-78-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324233458.1352854-1-sashal@kernel.org> References: <20240324233458.1352854-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Johannes Berg [ Upstream commit 91380f768d7f6e3d003755defa792e9a00a1444a ] Andrei reports that we just silently drop beacons after we report the key counters, but never report to userspace, so wpa_supplicant cannot send the WNM action frame. Fix that. Fixes: b1fdc2505abc ("iwlwifi: mvm: advertise BIGTK client support if avail= able") Reported-by: Andrei Otcheretianski Signed-off-by: Johannes Berg Reviewed-by: Gregory Greenman Signed-off-by: Miri Korenblit Link: https://msgid.link/20240128084842.7d855442cdce.Iba90b26f893dc8c49bfb8= be65373cd0a138af12c@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wi= reless/intel/iwlwifi/mvm/rxmq.c index 2e3eb7402197f..e1d0c79212311 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -305,6 +305,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *s= ta, u32 status, struct ieee80211_rx_status *stats) { + struct wireless_dev *wdev; struct iwl_mvm_sta *mvmsta; struct iwl_mvm_vif *mvmvif; u8 keyid; @@ -326,9 +327,15 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *= sta, if (!ieee80211_is_beacon(hdr->frame_control)) return 0; =20 + if (!sta) + return -1; + + mvmsta =3D iwl_mvm_sta_from_mac80211(sta); + mvmvif =3D iwl_mvm_vif_from_mac80211(mvmsta->vif); + /* key mismatch - will also report !MIC_OK but we shouldn't count it */ if (!(status & IWL_RX_MPDU_STATUS_KEY_VALID)) - return -1; + goto report; =20 /* good cases */ if (likely(status & IWL_RX_MPDU_STATUS_MIC_OK && @@ -337,13 +344,6 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *= sta, return 0; } =20 - if (!sta) - return -1; - - mvmsta =3D iwl_mvm_sta_from_mac80211(sta); - - mvmvif =3D iwl_mvm_vif_from_mac80211(mvmsta->vif); - /* * both keys will have the same cipher and MIC length, use * whichever one is available @@ -352,11 +352,11 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta = *sta, if (!key) { key =3D rcu_dereference(mvmvif->bcn_prot.keys[1]); if (!key) - return -1; + goto report; } =20 if (len < key->icv_len + IEEE80211_GMAC_PN_LEN + 2) - return -1; + goto report; =20 /* get the real key ID */ keyid =3D frame[len - key->icv_len - IEEE80211_GMAC_PN_LEN - 2]; @@ -370,7 +370,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *s= ta, return -1; key =3D rcu_dereference(mvmvif->bcn_prot.keys[keyid - 6]); if (!key) - return -1; + goto report; } =20 /* Report status to mac80211 */ @@ -378,6 +378,10 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *= sta, ieee80211_key_mic_failure(key); else if (status & IWL_RX_MPDU_STATUS_REPLAY_ERROR) ieee80211_key_replay(key); +report: + wdev =3D ieee80211_vif_to_wdev(mvmsta->vif); + if (wdev->netdev) + cfg80211_rx_unprot_mlme_mgmt(wdev->netdev, (void *)hdr, len); =20 return -1; } --=20 2.43.0