mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
wifi: mt76: mt7996: fix insecure data handling of mt7996_mcu_ie_countdown()
Coverity message: using tainted "hdr->band" variable as an index into an array "(*dev).mt76.phys". Reported-by: coverity-bot <[email protected]> Addresses-Coverity-ID: 1527797 ("Insecure data handling") Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
@@ -412,6 +412,9 @@ mt7996_mcu_ie_countdown(struct mt7996_dev *dev, struct sk_buff *skb)
|
||||
struct header *hdr = (struct header *)data;
|
||||
struct tlv *tlv = (struct tlv *)(data + 4);
|
||||
|
||||
if (hdr->band >= ARRAY_SIZE(dev->mt76.phys))
|
||||
return;
|
||||
|
||||
if (hdr->band && dev->mt76.phys[hdr->band])
|
||||
mphy = dev->mt76.phys[hdr->band];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user