Commit 9fe31054 authored by Felix Fietkau's avatar Felix Fietkau

mt76: add size check for additional rx fragments

So far the code only validates the buffer size of the first skb.
Extend this check to cover additional fragments as well, in case the size
is corrupted during a DMA reset.
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 4ad0be16
...@@ -430,6 +430,14 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget) ...@@ -430,6 +430,14 @@ mt76_dma_rx_process(struct mt76_dev *dev, struct mt76_queue *q, int budget)
if (!data) if (!data)
break; break;
if (q->buf_size < len + q->buf_offset) {
dev_kfree_skb(q->rx_head);
q->rx_head = NULL;
skb_free_frag(data);
continue;
}
if (q->rx_head) { if (q->rx_head) {
mt76_add_fragment(dev, q, data, len, more); mt76_add_fragment(dev, q, data, len, more);
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment