Re: [PATCH v2] mac80211: reject station addition if AP or MLO link is inactive
Johannes Berg <[email protected]> Fri, 31 Jul 2026 14:40:16 +0200
| Newsgroups | dev.linux.lists.syzbot,org.kernel.vger.linux-kernel,org.kernel.vger.linux-wireless |
|---|---|
| Message-ID | <[email protected]> |
On Mon, 2026-07-27 at 15:26 +0200, Slawomir Stepien wrote: > After taking a closer look at this I wonder how AP_VLAN should be handled= ? Is there a way on > cfg80211 level to be able to check AP_VLAN's main device state? Hmm, yeah that might be an issue? I guess in theory it could track it, but it doesn't. > My code change would look something like this: >=20 > @@ -9404,6 +9404,12 @@ static int nl80211_new_station(struct sk_buff *skb= , struct genl_info *info) > case NL80211_IFTYPE_AP: > case NL80211_IFTYPE_AP_VLAN: > case NL80211_IFTYPE_P2P_GO: > + /* Add new station only after the AP and link has been st= arted */ > + int link =3D params.link_sta_params.link_id >=3D 0 ? > + params.link_sta_params.link_id : 0; > + if (!wdev->links[link].ap.beacon_interval) > + return -ENETDOWN; > + > /* ignore WME attributes if iface/sta is not capable */ > if (!(rdev->wiphy.flags & WIPHY_FLAG_AP_UAPSD) || > !(params.sta_flags_set & BIT(NL80211_STA_FLAG_WME))) >=20 > but the NL80211_IFTYPE_AP_VLAN case would not work here, right? Can I jus= t do the checking only for > NL80211_IFTYPE_AP and NL80211_IFTYPE_P2P_GO and skip NL80211_IFTYPE_AP_VL= AN? Yeah it'd just reject everything, I guess. I think in practice stations are added at the AP interface first and then moved to a VLAN, which would argue for actually rejecting everything being OK anyway - but then that shouldn't be because of this but rather by just removing the AP_VLAN case there, or so. Not sure what the best thing would be though. johannes