]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: don't mark keys for inactive links as uploaded
authorMiri Korenblit <miriam.rachel.korenblit@intel.com>
Wed, 9 Jul 2025 20:38:00 +0000 (23:38 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 15 Jul 2025 09:00:39 +0000 (11:00 +0200)
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>
net/mac80211/key.c

index dcf8643a0baa507b3411a71b840a3fb55a90ce21..997892da8886f97210ec9b05877779878e1e400b 100644 (file)
@@ -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;
        }