summaryrefslogtreecommitdiff
path: root/net/mac80211
diff options
context:
space:
mode:
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>2025-07-09 23:38:00 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-13 15:33:57 -0500
commit23b8682f05ec545619711eb3572acd9484157bd8 (patch)
tree0fbdc1d76601148ff75a1ed84773c018c2e09106 /net/mac80211
parentc06a402459b15803fac2154587fd35040622689a (diff)
downloadlinux-23b8682f05ec545619711eb3572acd9484157bd8.tar.gz
linux-23b8682f05ec545619711eb3572acd9484157bd8.tar.bz2
linux-23b8682f05ec545619711eb3572acd9484157bd8.zip
wifi: mac80211: don't mark keys for inactive links as uploaded
[ Upstream commit 63df3956903748c5f374a0dfe7a89490714a4625 ] During resume, the driver can call ieee80211_add_gtk_rekey for keys that are not programmed into the device, e.g. keys of inactive links. Don't mark such a key as uploaded to avoid removing it later from the driver/device. Reviewed-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20250709233537.655094412b0b.Iacae31af3ba2a705da0a9baea976c2f799d65dc4@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com> Stable-dep-of: ed6a47346ec6 ("wifi: mac80211: fix key tailroom accounting leak") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/key.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index 67ecfea22982..7809fac6bae5 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -510,7 +510,8 @@ static int ieee80211_key_replace(struct ieee80211_sub_if_data *sdata,
} else {
if (!new->local->wowlan)
ret = ieee80211_key_enable_hw_accel(new);
- else
+ else if (link_id < 0 || !sdata->vif.active_links ||
+ BIT(link_id) & sdata->vif.active_links)
new->flags |= KEY_FLAG_UPLOADED_TO_HARDWARE;
}