From patchwork Tue Sep 26 08:07:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Greenman, Gregory" X-Patchwork-Id: 726684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A065BE7D24D for ; Tue, 26 Sep 2023 08:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233854AbjIZIIB (ORCPT ); Tue, 26 Sep 2023 04:08:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233850AbjIZIH7 (ORCPT ); Tue, 26 Sep 2023 04:07:59 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B00A711D for ; Tue, 26 Sep 2023 01:07:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695715673; x=1727251673; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j7BpSne/DpKSiCYdgZSY+UEOgIrykZxp7CdLzOi0PaI=; b=AJyECWzH3/8Y49aJClQ84h8jceI4U3FiFBotB+s/WPZtdi09TGSVzoED 2TAO8Gyv9zNs02GygcJQ9Sw44uaTdR/EWVt4us8qoSU/HREErc1IVR0DE EilbXDsvNPr4256Bs2PNclx7k8wo6yYE7oKi++WNLKBC3aIwpbGn4l7K5 cYhynOPczXC9W06j+h/IWFb5vtmNfhJObDZeQgaSKWRS349JucweaOebk 4L6CD8qXsG8SwhZRe20Pdo9T7uyRoPsNwJTtITk6yIBqjSG7wJHUo7iSQ 7xn/H24PvbWxSPjZ1arVzG9mTBqtRRsS96CIFt3s9s9RNjeMY9xBY2PAg Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="467797286" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="467797286" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 01:07:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="698369363" X-IronPort-AV: E=Sophos;i="6.03,177,1694761200"; d="scan'208";a="698369363" Received: from nbenitzh-mobl2.ger.corp.intel.com (HELO ggreenma-mobl2.intel.com) ([10.251.178.250]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2023 01:07:51 -0700 From: gregory.greenman@intel.com To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg , Gregory Greenman Subject: [PATCH 8/9] wifi: iwlwifi: mvm: use correct sta ID for IGTK/BIGTK Date: Tue, 26 Sep 2023 11:07:20 +0300 Message-Id: <20230926110319.dbc653913353.I82e90c86010f0b9588a180d9835fd11f666f5196@changeid> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230926080721.876640-1-gregory.greenman@intel.com> References: <20230926080721.876640-1-gregory.greenman@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg We don't (yet) send the IGTK down to the firmware, but when we do it needs to be with the broadcast station ID, not the multicast station ID. Same for the BIGTK, which we may send already if firmware advertises it (but it doesn't yet.) Fixes: a5de7de7e78e ("wifi: iwlwifi: mvm: enable TX beacon protection") Signed-off-by: Johannes Berg Signed-off-by: Gregory Greenman --- drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c index 2c9f2f71b083..f49820647041 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c @@ -24,10 +24,15 @@ static u32 iwl_mvm_get_sec_sta_mask(struct iwl_mvm *mvm, return 0; } - /* AP group keys are per link and should be on the mcast STA */ + /* AP group keys are per link and should be on the mcast/bcast STA */ if (vif->type == NL80211_IFTYPE_AP && - !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE)) + !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE)) { + /* IGTK/BIGTK to bcast STA */ + if (keyconf->keyidx >= 4) + return BIT(link_info->bcast_sta.sta_id); + /* GTK for data to mcast STA */ return BIT(link_info->mcast_sta.sta_id); + } /* for client mode use the AP STA also for group keys */ if (!sta && vif->type == NL80211_IFTYPE_STATION)