Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2621054lqp; Mon, 25 Mar 2024 04:50:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUu4zOkPkdEvPtzbRWwhnXMsTXmVYrU2Vo7f0qP25tA0WMbFTiEHuIDeF+Aq3XRfs2Omm0pzmBLJ1LFp0N2jK8InXG6oFRWXCxh9H8zHg== X-Google-Smtp-Source: AGHT+IFDeKgNoxbhfMlScwmPj4ytMonNcQP4Hm2Dt9j+UZ53vbJE9p4H5jYCtpm1A+dMNq+b2w2Z X-Received: by 2002:a92:d40e:0:b0:368:5080:535a with SMTP id q14-20020a92d40e000000b003685080535amr6292941ilm.32.1711367439145; Mon, 25 Mar 2024 04:50:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711367439; cv=pass; d=google.com; s=arc-20160816; b=o7e38Ob9qQ8gXWZuMXS0JG/QcQOMdeF2tlCQ578OCSG/gLsZvAUFygSq1oWx7vIBXn S4V5h9WE+KJP5ATGy+gFfg52qXVvFzFPpSYyFDSUxASdbGPhYhK47Kk+LNwXjv7SkQmN I9/KOr863gGI1YAZGd0CxlXr8LKrWSDhVbYy8w91XTLdsU0W0yoSeQHXURD56+YDps0s OFO5ed6I2yK4AJfx3/6PFic31B5XHzuryRfscmmGuNoJJ26LuEI6F6+GUc4yrrOF/XnY sXH/2hMo+lcnwGLHsx/BbGQtbC6ksIdcdjhRosNSD8V2aw5rM+AvGZ/3fnV31yV3UMkA qO3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=1toov5bJxtfvusmbA8k8zP/9eKFJGi9agxSSKqQbj+4=; fh=nKk1lvzmEFM2wE1chArUhpXJGjKnaGHfKs/HBGdbjNQ=; b=ScJVjjrXlKlDpbballwdyvF0ME7Y/1zeyPnBvTF0Wuk1pOWuSAkMSxwGJSF1buxyE1 ZUM+yeQ0ZKv289aEWn8p4giEHhCq457B8zl6LuogaOuOdYtNgeca98j9xd4WLCiOfnL1 C9PaG4POsRDyJi/C1Mbr8hzfd6rawxyezXVYnEG6k8OYNkXkem9rYOob3GC7A9xk118P 3U8+jbTAl6zT8YBw57NLjostw+CJSonCOSHRhIOxQIIq92NLn6tCJmum+krz750MQ5Pu lBu+o7rHxc7vKYs8DTRpbjx3srDfntbdHslmUSvaMzo5qDl/2SQzcsLommM55wkzDVo3 SNUg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cC5UmFtf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bv67-20020a632e46000000b005e84c73a015si7137725pgb.766.2024.03.25.04.50.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:50:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cC5UmFtf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115803-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115803-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C15602A4EF2 for ; Mon, 25 Mar 2024 11:42:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7ACB413C3CB; Mon, 25 Mar 2024 03:01:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cC5UmFtf" 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 2E5C3145FEA; Sun, 24 Mar 2024 23:14:04 +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=1711322045; cv=none; b=uc6urG5ZGRkmfQmgSSz+WrVK6bMlYJ37NIs0rRhcChhKuIjUV2zWa72aMi+ZOUuGu1U6LCHIRpO7MK327rD50wF/NdsGM2mMr2YRpKmehPW44h5fFK4KqpB0uEt3yDj7KjqT8mtyBpCXk5Q7Zii4a39z3lgS8/500lC6MmNLiBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322045; c=relaxed/simple; bh=0gpEjk4YZQFCV1DSJKnqukAGxncbpdcnwebr9pyXTSQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=vD3od4dZavstQT8VQ25vp+JKr9NCzmGt305NYABih4gAuMnQINM687qn3NXtcoSr0dVvi09krRGTi7l02cdjWrjAQlNL0QD3kkkuzNcoJr2Zr1dyN6opS6poD3sqbF4GfgFqDM/kjI5paKT4TW+ZrdI4N9Ajdc6S82jpRHhJ0WY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cC5UmFtf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42DEBC43390; Sun, 24 Mar 2024 23:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322044; bh=0gpEjk4YZQFCV1DSJKnqukAGxncbpdcnwebr9pyXTSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cC5UmFtfVQkjPcNdTfCUd5Cv3YkOsSwVkWrF05IoYK1cuAQKAPsMcez8rjOicgoHn 3YY0JrsmVpAIZwwT0/gTuvEdZozmTzqsfc6BylkIH/o7BvlBPc+XNeQmhL+EKyfTFU 8z/URSaq+ySQhSp+jqyHZNFWUf9BYW/70igLOOO3UzJDpa7mRTtwYFS0pu1460oDCx 9CXoEvWPUicQmBvtyXUk/89bkIyp3mu3V61yieR+jF9J3/DE7jcdcDKbkmD8u5q7ap Pyw+35dnI+pT/JuIqsLdOTnThL1DM/GiQ1zFQidRU+SPCwF8IIqhbBmNZxQzsl+A7F CdzmFLsfpci4Q== 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 6.1 116/451] wifi: iwlwifi: mvm: report beacon protection failures Date: Sun, 24 Mar 2024 19:06:32 -0400 Message-ID: <20240324231207.1351418-117-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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: 8bit 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 available") Reported-by: Andrei Otcheretianski Signed-off-by: Johannes Berg Reviewed-by: Gregory Greenman Signed-off-by: Miri Korenblit Link: https://msgid.link/20240128084842.7d855442cdce.Iba90b26f893dc8c49bfb8be65373cd0a138af12c@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/wireless/intel/iwlwifi/mvm/rxmq.c index f268a31ce26d9..105f283b777d2 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c @@ -299,6 +299,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta, u32 status, struct ieee80211_rx_status *stats) { + struct wireless_dev *wdev; struct iwl_mvm_sta *mvmsta; struct iwl_mvm_vif *mvmvif; u8 keyid; @@ -320,9 +321,15 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta, if (!ieee80211_is_beacon(hdr->frame_control)) return 0; + if (!sta) + return -1; + + mvmsta = iwl_mvm_sta_from_mac80211(sta); + mvmvif = 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; /* good cases */ if (likely(status & IWL_RX_MPDU_STATUS_MIC_OK && @@ -331,13 +338,6 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta, return 0; } - if (!sta) - return -1; - - mvmsta = iwl_mvm_sta_from_mac80211(sta); - - mvmvif = iwl_mvm_vif_from_mac80211(mvmsta->vif); - /* * both keys will have the same cipher and MIC length, use * whichever one is available @@ -346,11 +346,11 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta, if (!key) { key = rcu_dereference(mvmvif->bcn_prot.keys[1]); if (!key) - return -1; + goto report; } if (len < key->icv_len + IEEE80211_GMAC_PN_LEN + 2) - return -1; + goto report; /* get the real key ID */ keyid = frame[len - key->icv_len - IEEE80211_GMAC_PN_LEN - 2]; @@ -364,7 +364,7 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta, return -1; key = rcu_dereference(mvmvif->bcn_prot.keys[keyid - 6]); if (!key) - return -1; + goto report; } /* Report status to mac80211 */ @@ -372,6 +372,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 = ieee80211_vif_to_wdev(mvmsta->vif); + if (wdev->netdev) + cfg80211_rx_unprot_mlme_mgmt(wdev->netdev, (void *)hdr, len); return -1; } -- 2.43.0