mt76: clear skb pointers from rx aggregation reorder buffer during cleanup
authorFelix Fietkau <nbd@nbd.name>
Fri, 13 Dec 2019 23:15:26 +0000 (00:15 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 14 Feb 2020 09:06:02 +0000 (10:06 +0100)
During the cleanup of the aggregation session, a rx handler (or release timer)
on another CPU might still hold a pointer to the reorder buffer and could
attempt to release some packets.
Clearing pointers during cleanup avoids a theoretical use-after-free bug here.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/agg-rx.c

index a4c64ae..f77f035 100644 (file)
@@ -276,6 +276,7 @@ static void mt76_rx_aggr_shutdown(struct mt76_dev *dev, struct mt76_rx_tid *tid)
                if (!skb)
                        continue;
 
+               tid->reorder_buf[i] = NULL;
                tid->nframes--;
                dev_kfree_skb(skb);
        }