diff options
author | Johannes Berg | 2022-07-23 22:08:49 +0200 |
---|---|---|
committer | Johannes Berg | 2022-08-25 10:40:46 +0200 |
commit | b303835dabe0340f932ebb4e260d2229f79b0684 (patch) | |
tree | a83d2c0ae06569a5452fa97f236db2c52e12b37e /net | |
parent | 7dad3e39fde1eef97bc1a0b92e5d0f3500c9ed56 (diff) |
wifi: mac80211: accept STA changes without link changes
If there's no link ID, then check that there are no changes to
the link, and if so accept them, unless a new link is created.
While at it, reject creating a new link without an address.
This fixes authorizing an MLD (peer) that has no link 0.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/cfg.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index a4f6971b7a19..167acf843d75 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1610,6 +1610,18 @@ static int sta_link_apply_parameters(struct ieee80211_local *local, rcu_dereference_protected(sta->link[link_id], lockdep_is_held(&local->sta_mtx)); + /* + * If there are no changes, then accept a link that doesn't exist, + * unless it's a new link. + */ + if (params->link_id < 0 && !new_link && + !params->link_mac && !params->txpwr_set && + !params->supported_rates_len && + !params->ht_capa && !params->vht_capa && + !params->he_capa && !params->eht_capa && + !params->opmode_notif_used) + return 0; + if (!link || !link_sta) return -EINVAL; @@ -1625,6 +1637,8 @@ static int sta_link_apply_parameters(struct ieee80211_local *local, params->link_mac)) { return -EINVAL; } + } else if (new_link) { + return -EINVAL; } if (params->txpwr_set) { |