projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fbce613
)
wifi: mt76: mt7925: fix off by one in mt7925_load_clc()
author
Dan Carpenter
<dan.carpenter@linaro.org>
Wed, 11 Sep 2024 07:43:03 +0000
(10:43 +0300)
committer
Felix Fietkau
<nbd@nbd.name>
Mon, 13 Jan 2025 10:21:54 +0000
(11:21 +0100)
This comparison should be >= instead of > to prevent an out of bounds
read and write.
Fixes:
9679ca7326e5
("wifi: mt76: mt7925: fix a potential array-index-out-of-bounds issue for clc")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link:
https://patch.msgid.link/84bf5dd2-2fe3-4410-a7af-ae841e41082a@stanley.mountain
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
b/drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
index
748ea6a
..
0c2a233
100644
(file)
--- a/
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
+++ b/
drivers/net/wireless/mediatek/mt76/mt7925/mcu.c
@@
-638,7
+638,7
@@
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))
+ if (clc->idx >
=
ARRAY_SIZE(phy->clc))
break;
/* do not init buf again if chip reset triggered */