lkml.org 
[lkml]   [2008]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Bug in random32.c: all-zero outputs with probability 1/2^32, other seeding bugs

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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2008-07-02 08:41    [W:0.220 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site