From patchwork Fri Sep 25 21:30:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 259159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EA50C4727E for ; Fri, 25 Sep 2020 21:31:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C96F92075F for ; Fri, 25 Sep 2020 21:31:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728950AbgIYVbF (ORCPT ); Fri, 25 Sep 2020 17:31:05 -0400 Received: from paleale.coelho.fi ([176.9.41.70]:52322 "EHLO farmhouse.coelho.fi" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728733AbgIYVbD (ORCPT ); Fri, 25 Sep 2020 17:31:03 -0400 Received: from 91-156-6-193.elisa-laajakaista.fi ([91.156.6.193] helo=redipa.ger.corp.intel.com) by farmhouse.coelho.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kLvIz-002J1P-Hu; Sat, 26 Sep 2020 00:31:01 +0300 From: Luca Coelho To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org Date: Sat, 26 Sep 2020 00:30:44 +0300 Message-Id: X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200925213053.454459-1-luca@coelho.fi> References: <20200925213053.454459-1-luca@coelho.fi> MIME-Version: 1.0 Subject: [PATCH 06/15] iwlwifi: mvm: Don't install CMAC/GMAC key in AP mode Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Andrei Otcheretianski Due to a missing break, the management multicast key was installed even though we don't really support it. Fix that, so mac80211 would know that it should protect frames in software. Signed-off-by: Andrei Otcheretianski Signed-off-by: Luca Coelho --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 73280a2607a5..5e141eb47abc 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3438,15 +3438,16 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw, */ if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC || key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 || - key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) + key->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256) { ret = -EOPNOTSUPP; - else - ret = 0; + break; + } if (key->cipher != WLAN_CIPHER_SUITE_GCMP && key->cipher != WLAN_CIPHER_SUITE_GCMP_256 && !iwl_mvm_has_new_tx_api(mvm)) { key->hw_key_idx = STA_KEY_IDX_INVALID; + ret = 0; break; } @@ -3462,6 +3463,8 @@ static int __iwl_mvm_mac_set_key(struct ieee80211_hw *hw, if (i >= ARRAY_SIZE(mvmvif->ap_early_keys)) ret = -ENOSPC; + else + ret = 0; break; }