From 1f2b940056a45827f0f0486f3b72d88ec894d874 Mon Sep 17 00:00:00 2001 From: Ilan Peer Date: Wed, 3 Jun 2026 14:36:24 +0200 Subject: [PATCH] wifi: mac80211: Free keys associated with NAN Device 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 Link: https://patch.msgid.link/20260603143624.c6c771885383.I929410cb8efec4fab2d42ead396bfefaf9f803f1@changeid Signed-off-by: Johannes Berg --- net/mac80211/iface.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 56400c22d8bc..086272c3ec08 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -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);