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-next>] [day] [month] [year] [list]
Message-Id: <1470909883-5463-1-git-send-email-johannes@sipsolutions.net>
Date:	Thu, 11 Aug 2016 12:04:43 +0200
From:	Johannes Berg <johannes@...solutions.net>
To:	netdev@...r.kernel.org
Cc:	Eric Dumazet <edumazet@...gle.com>,
	Johannes Berg <johannes.berg@...el.com>
Subject: [PATCH] ipv6: suppress sparse warnings in IP6_ECN_set_ce()

From: Johannes Berg <johannes.berg@...el.com>

Use the correct type for these manipulations, which is __wsum,
instead of using __be32. 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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 0dc0a51da38f..89aa4e73fc37 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -119,14 +119,14 @@ struct ipv6hdr;
  */
 static inline int IP6_ECN_set_ce(struct sk_buff *skb, struct ipv6hdr *iph)
 {
-	__be32 from, to;
+	__wsum from, to;
 
 	if (INET_ECN_is_not_ect(ipv6_get_dsfield(iph)))
 		return 0;
 
-	from = *(__be32 *)iph;
-	to = from | htonl(INET_ECN_CE << 20);
-	*(__be32 *)iph = to;
+	from = *(__wsum *)iph;
+	to = from | (__force __wsum)htonl(INET_ECN_CE << 20);
+	*(__wsum *)iph = to;
 	if (skb->ip_summed == CHECKSUM_COMPLETE)
 		skb->csum = csum_add(csum_sub(skb->csum, from), to);
 	return 1;
-- 
2.8.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ