mirror of
https://github.com/outbackdingo/mt76.git
synced 2026-10-24 13:26:48 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user