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: <1371071476.3252.66.camel@edumazet-glaptop>
Date:	Wed, 12 Jun 2013 14:11:16 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	David Miller <davem@...emloft.net>
Cc:	netdev <netdev@...r.kernel.org>
Subject: [PATCH net-next] igmp: fix new sparse errors

From: Eric Dumazet <edumazet@...gle.com>

Fix following sparse errors :

net/ipv4/igmp.c:1222:25: warning: cast from restricted __be32
net/ipv4/igmp.c:1234:31: warning: incorrect type in assignment (different address spaces)
net/ipv4/igmp.c:1234:31:    expected struct ip_mc_list [noderef] <asn:4>*next_hash
net/ipv4/igmp.c:1234:31:    got struct ip_mc_list *<noident>
net/ipv4/igmp.c:1250:31: warning: incorrect type in assignment (different address spaces)
net/ipv4/igmp.c:1250:31:    expected struct ip_mc_list [noderef] <asn:4>*next_hash
net/ipv4/igmp.c:1250:31:    got struct ip_mc_list *<noident>
net/ipv4/igmp.c:2380:37: warning: cast from restricted __be32

These were added by commit e9897071350bd9
("igmp: hash a hash table to speedup ip_check_mc_rcu()")

Reported-by: kbuild test robot <fengguang.wu@...el.com>
Signed-off-by: Eric Dumazet <edumazet@...gle.com>
---
 net/ipv4/igmp.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index a09190d..cd71190 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1219,7 +1219,7 @@ static void igmp_group_added(struct ip_mc_list *im)
 
 static u32 ip_mc_hash(const struct ip_mc_list *im)
 {
-	return hash_32((u32)im->multiaddr, MC_HASH_SZ_LOG);
+	return hash_32((__force u32)im->multiaddr, MC_HASH_SZ_LOG);
 }
 
 static void ip_mc_hash_add(struct in_device *in_dev,
@@ -1231,7 +1231,7 @@ static void ip_mc_hash_add(struct in_device *in_dev,
 	mc_hash = rtnl_dereference(in_dev->mc_hash);
 	if (mc_hash) {
 		hash = ip_mc_hash(im);
-		im->next_hash = rtnl_dereference(mc_hash[hash]);
+		im->next_hash = mc_hash[hash];
 		rcu_assign_pointer(mc_hash[hash], im);
 		return;
 	}
@@ -1247,7 +1247,7 @@ static void ip_mc_hash_add(struct in_device *in_dev,
 
 	for_each_pmc_rtnl(in_dev, im) {
 		hash = ip_mc_hash(im);
-		im->next_hash = rtnl_dereference(mc_hash[hash]);
+		im->next_hash = mc_hash[hash];
 		RCU_INIT_POINTER(mc_hash[hash], im);
 	}
 
@@ -2377,7 +2377,7 @@ int ip_check_mc_rcu(struct in_device *in_dev, __be32 mc_addr, __be32 src_addr, u
 
 	mc_hash = rcu_dereference(in_dev->mc_hash);
 	if (mc_hash) {
-		u32 hash = hash_32((u32)mc_addr, MC_HASH_SZ_LOG);
+		u32 hash = hash_32((__force u32)mc_addr, MC_HASH_SZ_LOG);
 
 		for (im = rcu_dereference(mc_hash[hash]);
 		     im != NULL;


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ