]> git.ipfire.org Git - thirdparty/linux.git/commit
wifi: mt76: mt7921: fix a potential clc buffer length underflow
authorLeon Yen <leon.yen@mediatek.com>
Thu, 9 Oct 2025 02:01:58 +0000 (10:01 +0800)
committerFelix Fietkau <nbd@nbd.name>
Mon, 23 Mar 2026 09:23:00 +0000 (09:23 +0000)
commit5373f8b19e568b5c217832b9bbef165bd2b2df14
tree44c3efaa4876b8a86a1ba80df9f2b6d387baa2f6
parent4d0bf21e3e20619d51d06c0c36207aabab8b712c
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: fa6ad88e023d ("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>
drivers/net/wireless/mediatek/mt76/mt7921/mcu.c