Re: [PATCH net] net: gianfar: clear the pending Rx skb when freeing the Rx ring

From: Daniel Machon

Date: Mon Nov 16 2026 - 04:46:44 EST


> gfar_clean_rx_ring() keeps a frame that spans several Rx buffers in
> rx_queue->skb between NAPI polls. When the interface is stopped (close,
> MTU change, reset), free_skb_rx_queue() frees that skb but leaves the
> pointer set, and nothing clears it when the rings are set up again.
>
> After the restart, gfar_clean_rx_ring() picks up the stale pointer. The
> first buffer it sees has RXBD_FIRST set, so the overrun handling frees
> the skb a second time. By then the skb has usually been reallocated, so
> the second free releases another owner's skb and data while they are
> still in use.
>
> Clear rx_queue->skb after freeing it.
>
> Fixes: 75354148ce69 ("gianfar: Add paged allocation and Rx S/G")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Anthony Pighin <anthony.pighin@xxxxxxxxx>

Reviewed-by: Daniel Machon <daniel.machon@xxxxxxxxxxxxx>