wifi: mt76: mt7915: bound EEPROM access event before copying

mt7915_mcu_get_eeprom() copied a 16-byte block out of the firmware
response skb without checking that the response was long enough to hold
it. A short or malformed response could read past the end of the skb.
Reject a response shorter than the response header.

Fixes: 888208d1ccc4 ("wifi: mt76: mt7915: set correct background radar capability")
Signed-off-by: Felix Fietkau <[email protected]>
This commit is contained in:
Felix Fietkau
2026-08-01 17:46:20 +02:00
parent 591568f4e6
commit e308e7430d
+5
View File
@@ -2952,6 +2952,11 @@ int mt7915_mcu_get_eeprom(struct mt7915_dev *dev, u32 offset, u8 *read_buf)
return ret;
res = (struct mt7915_mcu_eeprom_info *)skb->data;
if (skb->len < sizeof(*res)) {
dev_kfree_skb(skb);
return -EINVAL;
}
if (!buf) {
u32 addr = le32_to_cpu(res->addr);