Re: Bug in random32.c: all-zero outputs with probability 1/2^32,other seeding bugs

From: Jan Engelhardt
Date: Wed Jul 02 2008 - 02:38:28 EST



On Wednesday 2008-07-02 01:19, Benoit Boissinot wrote:
>@@ -122,7 +122,7 @@
[ int i ]
>
> for_each_possible_cpu(i) {
> struct rnd_state *state = &per_cpu(net_rand_state,i);
>- __set_random32(state, i + jiffies);
>+ __set_random32(state, (u32) i + jiffies);
> }
> return 0;
> }

This cast does not make sense since
(int)i + jiffies â i + jiffies â (u32)i + jiffies mod 2^32
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/