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: <20180302211204.GH3887@localhost.localdomain>
Date:   Fri, 2 Mar 2018 18:12:04 -0300
From:   Marcelo Ricardo Leitner <marcelo.leitner@...il.com>
To:     Daniel Axtens <dja@...ens.net>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH v2 3/4] net: xfrm: use skb_gso_validate_network_len() to
 check gso sizes

On Thu, Mar 01, 2018 at 05:13:39PM +1100, Daniel Axtens wrote:
> Replace skb_gso_network_seglen() with
> skb_gso_validate_network_len(), as it considers the GSO_BY_FRAGS
> case.
> 
> Signed-off-by: Daniel Axtens <dja@...ens.net>

Reviewed-by: Marcelo Ricardo Leitner <marcelo.leitner@...il.com>

> ---
>  net/ipv4/xfrm4_output.c | 3 ++-
>  net/ipv6/xfrm6_output.c | 2 +-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c
> index 94b8702603bc..be980c195fc5 100644
> --- a/net/ipv4/xfrm4_output.c
> +++ b/net/ipv4/xfrm4_output.c
> @@ -30,7 +30,8 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
>  
>  	mtu = dst_mtu(skb_dst(skb));
>  	if ((!skb_is_gso(skb) && skb->len > mtu) ||
> -	    (skb_is_gso(skb) && skb_gso_network_seglen(skb) > ip_skb_dst_mtu(skb->sk, skb))) {
> +	    (skb_is_gso(skb) &&
> +	     !skb_gso_validate_network_len(skb, ip_skb_dst_mtu(skb->sk, skb)))) {
>  		skb->protocol = htons(ETH_P_IP);
>  
>  		if (skb->sk)
> diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
> index 8ae87d4ec5ff..5959ce9620eb 100644
> --- a/net/ipv6/xfrm6_output.c
> +++ b/net/ipv6/xfrm6_output.c
> @@ -82,7 +82,7 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
>  
>  	if ((!skb_is_gso(skb) && skb->len > mtu) ||
>  	    (skb_is_gso(skb) &&
> -	     skb_gso_network_seglen(skb) > ip6_skb_dst_mtu(skb))) {
> +	     !skb_gso_validate_network_len(skb, ip6_skb_dst_mtu(skb)))) {
>  		skb->dev = dst->dev;
>  		skb->protocol = htons(ETH_P_IPV6);
>  
> -- 
> 2.14.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ