Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH mt76-next 01/11] wifi: mt76: mt7921: validate CLC event length
@ 2026-10-24  7:19 Felix Fietkau
  2026-10-24  7:19 ` [PATCH mt76-next 02/11] wifi: mt76: mt7921: validate NIC capability TLV payload lengths Felix Fietkau
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Felix Fietkau @ 2026-10-24  7:19 UTC (permalink / raw)
  To: linux-wireless

With CLC_CAP_EVT_EN set, __mt7921_mcu_set_clc() reads chan_conf from the
SET_CLC response without checking the response length. A truncated
response causes an out-of-bounds read.

Reject a response that is too short for the CLC info TLV.

Fixes: 4fc8df50fd41 ("wifi: mt76: mt7921: get regulatory information from the clc event")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 drivers/net/wireless/mediatek/mt76/mt7921/mcu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
index 89d2c11b97ee..79fead3ccce1 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7921/mcu.c
@@ -1446,6 +1446,12 @@ int __mt7921_mcu_set_clc(struct mt792x_dev *dev, u8 *alpha2,
 		if (ret_skb) {
 			struct mt7921_clc_info_tlv *info;
 
+			if (ret_skb->len < 4 + offsetofend(struct mt7921_clc_info_tlv,
+							   chan_conf)) {
+				dev_kfree_skb(ret_skb);
+				return -EINVAL;
+			}
+
 			info = (struct mt7921_clc_info_tlv *)(ret_skb->data + 4);
 			dev->phy.clc_chan_conf = info->chan_conf;
 			dev_kfree_skb(ret_skb);
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-10-24  7:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-24  7:19 [PATCH mt76-next 01/11] wifi: mt76: mt7921: validate CLC event length Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 02/11] wifi: mt76: mt7921: validate NIC capability TLV payload lengths Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 03/11] wifi: mt76: mt7925: validate NIC capability TLV lengths Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 04/11] wifi: mt76: mt7925: free the MCU event when linearising fails Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 05/11] wifi: mt76: mt7996: validate radar, thermal and WED RRO event lengths Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 06/11] wifi: mt76: connac: validate the RAM firmware region table Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 07/11] wifi: mt76: mt7996: " Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 08/11] wifi: mt76: mt7925: validate CLC firmware regions and records Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 09/11] wifi: mt76: connac: validate the ROM patch section table Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 10/11] wifi: mt76: mt7996: " Felix Fietkau
2026-10-24  7:19 ` [PATCH mt76-next 11/11] wifi: mt76: mt792x: use mt76_connac2_fw_check() Felix Fietkau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox