]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: mac80211: Allow per station GTK for NAN Data interfaces
authorIlan Peer <ilan.peer@intel.com>
Wed, 13 May 2026 14:24:22 +0000 (17:24 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 20 May 2026 10:03:00 +0000 (12:03 +0200)
The WiFi Aware specification (v4.0) requires that NAN devices that
support security would also support per station GTK. Thus, allow
per station GTK installation to the driver on NAN Data interfaces.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Tested-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
tested: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20260513172418.37a8e259e611.I39bb9f3c1a65a8184124f531c18e121dc123d411@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/key.c

index 4b8965633df34c9e5a12f55017de33e2fb4f1bd9..3030bd40bca007c6fac2953333c3a3c5d78e488c 100644 (file)
@@ -6,7 +6,7 @@
  * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2013-2014  Intel Mobile Communications GmbH
  * Copyright 2015-2017 Intel Deutschland GmbH
- * Copyright 2018-2020, 2022-2025  Intel Corporation
+ * Copyright 2018-2020, 2022-2026  Intel Corporation
  */
 
 #include <crypto/utils.h>
@@ -150,11 +150,14 @@ static int ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
        sta = key->sta;
 
        /*
-        * If this is a per-STA GTK, check if it
-        * is supported; if not, return.
+        * Allow installation of a per-STA GTK if per-STA GTK is supported
+        * by the driver or the interface is a NAN Data interface (as
+        * per-station GTKs are required to be supported if secure NAN is
+        * supported).
         */
        if (sta && !(key->conf.flags & IEEE80211_KEY_FLAG_PAIRWISE) &&
-           !ieee80211_hw_check(&key->local->hw, SUPPORTS_PER_STA_GTK))
+           !(ieee80211_hw_check(&key->local->hw, SUPPORTS_PER_STA_GTK) ||
+             sdata->vif.type == NL80211_IFTYPE_NAN_DATA))
                goto out_unsupported;
 
        if (sta && !sta->uploaded)