]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: Free keys associated with NAN Device
authorIlan Peer <ilan.peer@intel.com>
Wed, 3 Jun 2026 12:36:24 +0000 (14:36 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 4 Jun 2026 11:03:53 +0000 (13:03 +0200)
A NAN Device interface can have keys associated with it, e.g.,
IGTK and BIGTK used for Tx. When a NAN Device interface is stopped,
we need to clear these keys.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Link: https://patch.msgid.link/20260603143624.c6c771885383.I929410cb8efec4fab2d42ead396bfefaf9f803f1@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/iface.c

index 56400c22d8bcbf36447507ea9a8fade27561b97a..086272c3ec08c1555e4c37ed5a892d701ad529a9 100644 (file)
@@ -648,6 +648,12 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
 
                        spin_unlock_bh(&sdata->u.nan.de.func_lock);
                }
+
+               /*
+                * Free the remaining keys that might be associated with the
+                * NAN interface, e.g., IGTK and BIGTK used for Tx.
+                */
+               ieee80211_free_keys(sdata, true);
                break;
        case NL80211_IFTYPE_NAN_DATA:
                RCU_INIT_POINTER(sdata->u.nan_data.nmi, NULL);