mirror of
https://github.com/torvalds/linux.git
synced 2026-05-24 07:03:03 +02:00
wifi: mt76: mt7921: fix a potential clc buffer length underflow
The buf_len is used to limit the iterations for retrieving the country
power setting and may underflow under certain conditions due to changes
in the power table in CLC.
This underflow leads to an almost infinite loop or an invalid power
setting resulting in driver initialization failure.
Cc: stable@vger.kernel.org
Fixes: fa6ad88e02 ("wifi: mt76: mt7921: fix country count limitation for CLC")
Signed-off-by: Leon Yen <leon.yen@mediatek.com>
Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@mediatek.com>
Link: https://patch.msgid.link/20251009020158.1923429-1-mingyen.hsieh@mediatek.com
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
parent
4d0bf21e3e
commit
5373f8b19e
|
|
@ -1353,6 +1353,9 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
|
|||
u16 len = le16_to_cpu(rule->len);
|
||||
u16 offset = len + sizeof(*rule);
|
||||
|
||||
if (buf_len < offset)
|
||||
break;
|
||||
|
||||
pos += offset;
|
||||
buf_len -= offset;
|
||||
if (rule->alpha2[0] != alpha2[0] ||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user