[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170118034907.spozwf4erlvx5s4x@thunk.org>
Date: Tue, 17 Jan 2017 22:49:07 -0500
From: Theodore Ts'o <tytso@....edu>
To: "Jason A. Donenfeld" <Jason@...c4.com>
Cc: linux-kernel@...r.kernel.org,
Hannes Frederic Sowa <hannes@...essinduktion.org>,
Andy Lutomirski <luto@...capital.net>
Subject: Re: [PATCH 1/2] random: use chacha20 for get_random_int/long
Hi Jason,
I've been taking a look at your patch, and i think it's... problematic.
You're using a union for the entropy_u64 and entropy_u32 arrays, and
the position field is used to indexed into those two arrays.
So if the first caller calls get_random_u64 with position=0, it will
get the first 64 bits out of the batched entropy, and increment the
position to 1. If the second caller calls get_random_u32 with
position=1... it will get the second of the 32-bit chunks in the
batched entropy array --- which will include the 64 bits returned to
the first caller.
That's not very random. :-(
- Ted
Powered by blists - more mailing lists