Commit 4330a0e
committed
wifi: mt76: mt7996: fix out-of-bounds link array access in mt7996_tx()
When mac80211 leaves the link unspecified, mt7996_tx() substitutes the
primary link id of the station or vif. That value is
IEEE80211_LINK_UNSPECIFIED (0xf) until the first link has been added,
and it is then used unchecked to index vif->link_conf[],
mvif->mt76.link[] and sta->link[], all of which hold
IEEE80211_MLD_MAX_NUM_LINKS (15) entries.
Clamp the primary link id to the default link before using it, and use
the clamped value for the link_sta fallback as well.
Fixes: 1609b01 ("wifi: mt76: mt7996: Overwrite unspecified link_id in mt7996_tx()")
Link: https://patch.msgid.link/20260801145334.1166751-10-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>1 parent 9ba744a commit 4330a0e
1 file changed
Lines changed: 13 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| 1518 | + | |
1518 | 1519 | | |
1519 | 1520 | | |
1520 | 1521 | | |
1521 | 1522 | | |
1522 | 1523 | | |
| 1524 | + | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
1523 | 1533 | | |
1524 | 1534 | | |
1525 | 1535 | | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
| 1536 | + | |
| 1537 | + | |
1532 | 1538 | | |
1533 | 1539 | | |
1534 | 1540 | | |
| |||
1538 | 1544 | | |
1539 | 1545 | | |
1540 | 1546 | | |
1541 | | - | |
| 1547 | + | |
1542 | 1548 | | |
1543 | 1549 | | |
1544 | 1550 | | |
| |||
0 commit comments