Skip to content

Commit 5cc66fd

Browse files
committed
wifi: iwlwifi: mvm: don't set the MFP flag for the GTK
jira LE-1907 cve CVE-2024-27434 Rebuild_History Non-Buildable kernel-5.14.0-427.31.1.el9_4 commit-author Emmanuel Grumbach <emmanuel.grumbach@intel.com> commit e35f316 The firmware doesn't need the MFP flag for the GTK, it can even make the firmware crash. in case the AP is configured with: group cipher TKIP and MFPC. We would send the GTK with cipher = TKIP and MFP which is of course not possible. Fixes: 5c75a20 ("wifi: iwlwifi: mvm: support new key API") Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240206175739.2f2c602ab3c6.If13b2e2fa532381d985c07df130bee1478046c89@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> (cherry picked from commit e35f316) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 35d0d67 commit 5cc66fd

File tree

1 file changed

+11
-7
lines changed
  • drivers/net/wireless/intel/iwlwifi/mvm

1 file changed

+11
-7
lines changed

drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
22
/*
3-
* Copyright (C) 2022 - 2023 Intel Corporation
3+
* Copyright (C) 2022 - 2024 Intel Corporation
44
*/
55
#include <linux/kernel.h>
66
#include <net/mac80211.h>
@@ -62,11 +62,13 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,
6262
struct ieee80211_key_conf *keyconf)
6363
{
6464
struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
65+
bool pairwise = keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE;
66+
bool igtk = keyconf->keyidx == 4 || keyconf->keyidx == 5;
6567
u32 flags = 0;
6668

6769
lockdep_assert_held(&mvm->mutex);
6870

69-
if (!(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE))
71+
if (!pairwise)
7072
flags |= IWL_SEC_KEY_FLAG_MCAST_KEY;
7173

7274
switch (keyconf->cipher) {
@@ -96,12 +98,14 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,
9698
if (!sta && vif->type == NL80211_IFTYPE_STATION)
9799
sta = mvmvif->ap_sta;
98100

99-
/* Set the MFP flag also for an AP interface where the key is an IGTK
100-
* key as in such a case the station would always be NULL
101+
/*
102+
* If we are installing an iGTK (in AP or STA mode), we need to tell
103+
* the firmware this key will en/decrypt MGMT frames.
104+
* Same goes if we are installing a pairwise key for an MFP station.
105+
* In case we're installing a groupwise key (which is not an iGTK),
106+
* then, we will not use this key for MGMT frames.
101107
*/
102-
if ((!IS_ERR_OR_NULL(sta) && sta->mfp) ||
103-
(vif->type == NL80211_IFTYPE_AP &&
104-
(keyconf->keyidx == 4 || keyconf->keyidx == 5)))
108+
if ((!IS_ERR_OR_NULL(sta) && sta->mfp && pairwise) || igtk)
105109
flags |= IWL_SEC_KEY_FLAG_MFP;
106110

107111
return flags;

0 commit comments

Comments
 (0)