mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 21:36:52 +00:00
wifi: mt76: mt7925: fix a potential array-index-out-of-bounds issue for clc
Due to the lack of checks on the clc array, if the firmware supports more clc configuration, it will cause illegal memory access. Cc: [email protected] Fixes: c948b5da6bbe ("wifi: mt76: mt7925: add Mediatek Wi-Fi7 driver for mt7925 chips") Signed-off-by: Ming Yen Hsieh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
committed by
Felix Fietkau
parent
d4b3b302ce
commit
922e515bd8
@@ -638,6 +638,9 @@ static int mt7925_load_clc(struct mt792x_dev *dev, const char *fw_name)
|
||||
for (offset = 0; offset < len; offset += le32_to_cpu(clc->len)) {
|
||||
clc = (const struct mt7925_clc *)(clc_base + offset);
|
||||
|
||||
if (clc->idx > ARRAY_SIZE(phy->clc))
|
||||
break;
|
||||
|
||||
/* do not init buf again if chip reset triggered */
|
||||
if (phy->clc[clc->idx])
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user