From abd7d869392f8cdd05aa880d75bb5b0f0f82513d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sat, 14 Dec 2019 00:15:26 +0100 Subject: [PATCH] mt76: clear skb pointers from rx aggregation reorder buffer during cleanup 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 --- agg-rx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/agg-rx.c b/agg-rx.c index 53b5a4b2..db093bfa 100644 --- a/agg-rx.c +++ b/agg-rx.c @@ -268,6 +268,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); }