[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.1.10.0807020835200.20393@fbirervta.pbzchgretzou.qr>
Date: Wed, 2 Jul 2008 08:38:16 +0200 (CEST)
From: Jan Engelhardt <jengelh@...ozas.de>
To: Benoit Boissinot <bboissin@...il.com>
cc: linux-kernel@...r.kernel.org, Jack Lloyd <lloyd@...dombit.net>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: 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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists