On Fri, Jul 8, 2011 at 11:06 AM, David Miller [off-list ref] wrote:
Ok, there was also an unintended bug in my original patch,
I lost the bottom 8 bits in the fold, the hash function
should instead be:
+static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd)
+{
+ u32 val = key ^ dev->ifindex ^ hash_rnd;
+
+ return val ^ (val >> 8) ^ (val >> 16) ^ (val >> 24);
+}
Doesn't seem to matter much -- this is now equivalent to
a = key ^ dev->ifindex
return (a ^ (a >> 8) ^ (a >> 16) ^ (a >> 24)) // (1)
^ (rnd ^ (rnd >> 8) ^ (rnd >> 16) ^ (rnd >> 24)) // (2)
where again the attacker controls (1), and (2) is a constant.