[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZzZD_Dh9H8M7JxDs@mini-arch>
Date: Thu, 14 Nov 2024 10:39:56 -0800
From: Stanislav Fomichev <stfomichev@...il.com>
To: Felix Maurer <fmaurer@...hat.com>
Cc: bpf@...r.kernel.org, bjorn@...nel.org, magnus.karlsson@...el.com,
maciej.fijalkowski@...el.com, jonathan.lemon@...il.com,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, horms@...nel.org, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
yoong.siang.song@...el.com, sdf@...ichev.me, netdev@...r.kernel.org,
Michal Schmidt <mschmidt@...hat.com>
Subject: Re: [PATCH bpf] xsk: Free skb when TX metadata options are invalid
On 11/14, Felix Maurer wrote:
> 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@...hat.com>
> Signed-off-by: Felix Maurer <fmaurer@...hat.com>
> ---
Acked-by: Stanislav Fomichev <sdf@...ichev.me>
Reminds me of the following:
https://lore.kernel.org/netdev/ZNvB9AUzNIzwMW6+@google.com/#t
Maybe I need to try to cleanup this path. Too many corner cases so it's
impossible to get right :-(
Powered by blists - more mailing lists