lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <willemdebruijn.kernel.218d53621fba7@gmail.com>
Date: Mon, 26 Jan 2026 12:53:31 -0500
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Gal Pressman <gal@...dia.com>, 
 "David S. Miller" <davem@...emloft.net>, 
 Eric Dumazet <edumazet@...gle.com>, 
 Jakub Kicinski <kuba@...nel.org>, 
 Paolo Abeni <pabeni@...hat.com>, 
 Andrew Lunn <andrew+netdev@...n.ch>, 
 netdev@...r.kernel.org
Cc: Igor Russkikh <irusskikh@...vell.com>, 
 Boris Pismenny <borisp@...dia.com>, 
 Saeed Mahameed <saeedm@...dia.com>, 
 Leon Romanovsky <leon@...nel.org>, 
 Tariq Toukan <tariqt@...dia.com>, 
 Mark Bloch <mbloch@...dia.com>, 
 David Ahern <dsahern@...nel.org>, 
 Simon Horman <horms@...nel.org>, 
 Alexander Duyck <alexanderduyck@...com>, 
 linux-rdma@...r.kernel.org, 
 Gal Pressman <gal@...dia.com>, 
 Dragos Tatulea <dtatulea@...dia.com>
Subject: Re: [PATCH net-next 1/3] udp: gso: Use single MSS length in UDP
 header for GSO_PARTIAL

Gal Pressman wrote:
> In GSO_PARTIAL segmentation, set the UDP length field to the single
> segment size (gso_size + UDP header) instead of the large MSS size.
> This provides hardware with a template length value for final
> segmentation, similar to how tunnel GSO_PARTIAL handles outer headers
> in UDP tunnels.
> 
> This will remove the need to manually adjust the UDP header length in
> the drivers, as can be seen in subsequent patches.
> 
> This was suggested by Alex in 2018:
> https://lore.kernel.org/netdev/CAKgT0UcdnUWgr3KQ=RnLKigokkiUuYefmL-ePpDvJOBNpKScFA@mail.gmail.com/
> 
> Reviewed-by: Dragos Tatulea <dtatulea@...dia.com>
> Signed-off-by: Gal Pressman <gal@...dia.com>

Reviewed-by: Willem de Bruijn <willemb@...gle.com>

This only affects the udp header value when using GSO_PARTIAL, and
these are the only two drivers that adversize USO using GSO_PARTIAL.

> ---
>  net/ipv4/udp_offload.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/udp_offload.c b/net/ipv4/udp_offload.c
> index 19d0b5b09ffa..89e0b48b60ae 100644
> --- a/net/ipv4/udp_offload.c
> +++ b/net/ipv4/udp_offload.c
> @@ -483,11 +483,11 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
>  	struct sock *sk = gso_skb->sk;
>  	unsigned int sum_truesize = 0;
>  	struct sk_buff *segs, *seg;
> +	__be16 newlen, msslen;
>  	struct udphdr *uh;
>  	unsigned int mss;
>  	bool copy_dtor;
>  	__sum16 check;
> -	__be16 newlen;
>  	int ret = 0;
>  
>  	mss = skb_shinfo(gso_skb)->gso_size;
> @@ -555,6 +555,8 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
>  		return segs;
>  	}
>  
> +	msslen = htons(sizeof(*uh) + mss);
> +
>  	/* GSO partial and frag_list segmentation only requires splitting
>  	 * the frame into an MSS multiple and possibly a remainder, both
>  	 * cases return a GSO skb. So update the mss now.
> @@ -584,7 +586,7 @@ struct sk_buff *__udp_gso_segment(struct sk_buff *gso_skb,
>  		if (!seg->next)
>  			break;
>  
> -		uh->len = newlen;
> +		uh->len = msslen;
>  		uh->check = check;
>  
>  		if (seg->ip_summed == CHECKSUM_PARTIAL)
> -- 
> 2.40.1
> 



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ