Felix Maurer <fmaurer@xxxxxxxxxx> writes: > When a new skb is allocated for transmitting an xsk descriptor, i.e., for > every non-multibuf descriptor or the first frag of a multibuf descriptor, > but the descriptor is later found to have invalid options set for the TX > metadata, the new skb is never freed. This can leak skbs until the send > buffer is full which makes sending more packets impossible. > > Fix this by freeing the skb in the error path if we are currently dealing > with the first frag, i.e., an skb allocated in this iteration of > xsk_build_skb. > > Fixes: 48eb03dd2630 ("xsk: Add TX timestamp and TX checksum offload support") > Reported-by: Michal Schmidt <mschmidt@xxxxxxxxxx> > Signed-off-by: Felix Maurer <fmaurer@xxxxxxxxxx> Reviewed-by: Toke Høiland-Jørgensen <toke@xxxxxxxxxx>