net: mvneta: fix possible use-after-free in mvneta_xdp_put_buff
Release first buffer as last one since it contains references to subsequent fragments. This code will be optimized introducing multi-buffer bit in xdp_buff structure. Fixes: ca0e014609f05 ("net: mvneta: move skb build after descriptors processing") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Acked-by: Jesper Dangaard Brouer <brouer@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5bf490e680
commit
9d3b2d3e49
@ -2029,11 +2029,11 @@ mvneta_xdp_put_buff(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
|
||||
struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp);
|
||||
int i;
|
||||
|
||||
page_pool_put_page(rxq->page_pool, virt_to_head_page(xdp->data),
|
||||
sync_len, napi);
|
||||
for (i = 0; i < sinfo->nr_frags; i++)
|
||||
page_pool_put_full_page(rxq->page_pool,
|
||||
skb_frag_page(&sinfo->frags[i]), napi);
|
||||
page_pool_put_page(rxq->page_pool, virt_to_head_page(xdp->data),
|
||||
sync_len, napi);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Reference in New Issue
Block a user