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: <1471007495.12189.8.camel@edumazet-glaptop3.roam.corp.google.com>
Date:	Fri, 12 Aug 2016 09:11:35 -0400
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Johannes Berg <johannes@...solutions.net>
Cc:	netdev@...r.kernel.org, Eric Dumazet <edumazet@...gle.com>,
	Johannes Berg <johannes.berg@...el.com>
Subject: Re: [PATCH v2] ipv6: suppress sparse warnings in IP6_ECN_set_ce()

On Fri, 2016-08-12 at 07:48 +0200, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@...el.com>
> 
> Pass the correct type __wsum to csum_sub() and csum_add(). This doesn't
> really change anything since __wsum really *is* __be32, but removes the
> address space warnings from sparse.
> 
> Cc: Eric Dumazet <edumazet@...gle.com>
> Fixes: 34ae6a1aa054 ("ipv6: update skb->csum when CE mark is propagated")
> Signed-off-by: Johannes Berg <johannes.berg@...el.com>
> ---
>  include/net/inet_ecn.h | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
> index 0dc0a51da38f..dce2d586d9ce 100644
> --- a/include/net/inet_ecn.h
> +++ b/include/net/inet_ecn.h
> @@ -128,7 +128,8 @@ static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph)
>  	to = from | htonl(INET_ECN_CE << 20);
>  	*(__be32 *)iph = to;
>  	if (skb->ip_summed == CHECKSUM_COMPLETE)
> -		skb->csum = csum_add(csum_sub(skb->csum, from), to);
> +		skb->csum = csum_add(csum_sub(skb->csum, (__force __wsum)from),
> +				     (__force __wsum)to);
>  	return 1;
>  }
>  

Thanks Johannes

Acked-by: Eric Dumazet <edumazet@...gle.com>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ