[PATCH net] net: stmmac: fix TSO header length truncation

Maxime Chevallier maxime.chevallier at bootlin.com
Fri Sep 11 02:28:37 PDT 2026


Hi

On 9/11/26 11:20, Lorenzo Bianconi wrote:
> stmmac_tso_xmit() stores the protocol header length returned by
> stmmac_tso_header_size() in a u8. stmmac_tso_valid_packet() admits
> headers up to 1023 bytes, so a header longer than 255 bytes wraps modulo
> 256 (486 becomes 230, 256 becomes 0).
> 
> A TCP over IPv6 socket carrying a few hundred bytes of sticky
> destination/hop-by-hop options makes skb_tcp_all_headers() exceed 255
> while staying below the 1023-byte limit, so such an skb reaches
> stmmac_tso_xmit().
> 
> Widen proto_hdr_len to unsigned int, which is sufficient since the value
> is bounded by the hardware limit, and adjust the debug print specifier
> accordingly.
> 
> Fixes: 9edfa7dab811 ("net: stmmac: enable TSO for IPv6")
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at oss.qualcomm.com>

Reviewed-by: Maxime Chevallier <maxime.chevallier at bootlin.com>

Maxime




More information about the linux-arm-kernel mailing list