mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-13 07:08:21 -04:00
mt76: mt76x02: add check for invalid vif idx
On adding vifs the idx can become 1 + (7 & 7) = 8 for APs. Check against that, as only AP vif idx 0-7 is possible. Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de> Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
committed by
Felix Fietkau
parent
f27469a933
commit
7d2886404e
@@ -325,7 +325,9 @@ mt76x02_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
|
||||
if (vif->type == NL80211_IFTYPE_STATION)
|
||||
idx += 8;
|
||||
|
||||
if (dev->vif_mask & BIT(idx))
|
||||
/* vif is already set or idx is 8 for AP/Mesh/... */
|
||||
if (dev->vif_mask & BIT(idx) ||
|
||||
(vif->type != NL80211_IFTYPE_STATION && idx > 7))
|
||||
return -EBUSY;
|
||||
|
||||
dev->vif_mask |= BIT(idx);
|
||||
|
||||
Reference in New Issue
Block a user