]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
wifi: mac80211: check ieee80211_rx_data_set_link return in pubsta MLO path
authorMichael Bommarito <michael.bommarito@gmail.com>
Wed, 22 Apr 2026 00:06:51 +0000 (20:06 -0400)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 27 Apr 2026 10:41:33 +0000 (12:41 +0200)
commit9b55d5c1f5e481e391957f9096d798ca331c461b
tree4c394973523c04401809f193e79ed7e115dd3fa8
parent381cd547bc6e35a610c5dfebe554d891eea40f03
wifi: mac80211: check ieee80211_rx_data_set_link return in pubsta MLO path

__ieee80211_rx_handle_packet() resolves the link via
ieee80211_rx_data_set_link() on the pubsta->mlo path but ignores the
helper's return value.  Inside the helper,
  rx->link = rcu_dereference(rx->sdata->link[link_id]);
can leave rx->link NULL if link_id references a slot already cleared
by ieee80211_vif_set_links() during station-initiated ML
reconfiguration (see mlme.c's ieee80211_ml_reconfiguration(), which
invalidates sdata->link[] before the matching
ieee80211_sta_remove_link() loop walks the link-sta hash).  RX dispatch
still resolves a link_sta from the hash and then drops into
ieee80211_prepare_and_rx_handle(), which dereferences link->conf->addr.

Every other user site of ieee80211_rx_data_set_link() checks the return
and bails on failure; only this branch did not.  Mirror the safe
pattern.

Fixes: e66b7920aa5a ("wifi: mac80211: fix initialization of rx->link and rx->link_sta")
Assisted-by: Claude:claude-opus-4-7
Signed-off-by: Michael Bommarito <michael.bommarito@gmail.com>
Link: https://patch.msgid.link/20260422000651.4184602-1-michael.bommarito@gmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rx.c