]> Git Repo - linux.git/commit
xsk: Free skb when TX metadata options are invalid
authorFelix Maurer <[email protected]>
Thu, 14 Nov 2024 11:30:05 +0000 (12:30 +0100)
committerJakub Kicinski <[email protected]>
Fri, 15 Nov 2024 22:26:40 +0000 (14:26 -0800)
commit0c0d0f42ffa6ac94cd79893b7ed419c15e1b45de
tree6a4f23392edcca153b201a2bd85ebaeeff2f39d4
parent8807850697715b6ed3498adf6b6b2411ccfa52c6
xsk: Free skb when TX metadata options are invalid

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 <[email protected]>
Signed-off-by: Felix Maurer <[email protected]>
Reviewed-by: Toke Høiland-Jørgensen <[email protected]>
Acked-by: Stanislav Fomichev <[email protected]>
Acked-by: Martin KaFai Lau <[email protected]>
Link: https://patch.msgid.link/edb9b00fb19e680dff5a3350cd7581c5927975a8.1731581697.git.fmaurer@redhat.com
Signed-off-by: Jakub Kicinski <[email protected]>
net/xdp/xsk.c
This page took 0.051268 seconds and 4 git commands to generate.