Re: [PATCH net] xsk: reject TX checksum requests that overflow skb->csum_start
From: Stanislav Fomichev
Date: Thu Nov 19 2026 - 11:51:29 EST
On 11/16, Tianyi Gao wrote:
> xsk_skb_metadata() sets the u16 skb->csum_start to hr + csum_start. With
> 64K pages, csum_start can be close to U16_MAX, so the sum can overflow.
> The checksum offset then becomes negative. With XDP_UMEM_TX_SW_CSUM,
> skb_checksum_help() triggers a warning. Without it, the device gets a
> CHECKSUM_PARTIAL skb with a negative offset.
>
> Reject this with -EINVAL. Use the limit of skb_partial_csum_set(), which
> also rejects U16_MAX, the "not set" value of transport_header. That
> helper cannot be used here, as the skb built for an IFF_TX_SKB_NO_LINEAR
> device has no linear data.
>
> Fixes: 48eb03dd2630 ("xsk: Add TX timestamp and TX checksum offload support")
> Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> Closes: https://lore.kernel.org/all/sashiko-outbox-203545@xxxxxxxxxx/
> Signed-off-by: Tianyi Gao <tianyi@xxxxxxxxxxxxxx>
Acked-by: Stanislav Fomichev <sdf@xxxxxxxxxxx>