Skip to content

Commit 4e10a73

Browse files
LorenzoBianconijmberg-intel
authored andcommitted
wifi: mt76: Fix possible oob access in mt76_connac2_mac_write_txwi_80211()
Check frame length before accessing the mgmt fields in mt76_connac2_mac_write_txwi_80211 in order to avoid a possible oob access. Fixes: 577dbc6 ("mt76: mt7915: enable offloading of sequence number assignment") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Link: https://patch.msgid.link/20260226-mt76-addba-req-oob-access-v1-3-b0f6d1ad4850@kernel.org [fix check to also cover mgmt->u.action.u.addba_req.capab, correct Fixes tag] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent c41a9ab commit 4e10a73

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,7 @@ mt76_connac2_mac_write_txwi_80211(struct mt76_dev *dev, __le32 *txwi,
413413
u32 val;
414414

415415
if (ieee80211_is_action(fc) &&
416+
skb->len >= IEEE80211_MIN_ACTION_SIZE + 1 + 1 + 2 &&
416417
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
417418
mgmt->u.action.u.addba_req.action_code == WLAN_ACTION_ADDBA_REQ) {
418419
u16 capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab);

0 commit comments

Comments
 (0)