Re: [PATCH] random: only use gathered bytes from arch_get_random_long

2012-07-07 Thread Kees Cook
On Sat, Jul 07, 2012 at 02:23:16PM -0400, Theodore Ts'o wrote: > On Sat, Jul 07, 2012 at 10:11:22AM -0700, Kees Cook wrote: > > While very unlikely, it is possible for arch_get_random_long() to fail > > in the middle of the loop in xfer_secondary_pool(), which would mean > > that the loop could sto

Re: [PATCH] random: only use gathered bytes from arch_get_random_long

2012-07-07 Thread Theodore Ts'o
On Sat, Jul 07, 2012 at 10:11:22AM -0700, Kees Cook wrote: > While very unlikely, it is possible for arch_get_random_long() to fail > in the middle of the loop in xfer_secondary_pool(), which would mean > that the loop could stop with only part of u.hwrand populated, leading > to mix_pool_bytes() i

[PATCH] random: only use gathered bytes from arch_get_random_long

2012-07-07 Thread Kees Cook
While very unlikely, it is possible for arch_get_random_long() to fail in the middle of the loop in xfer_secondary_pool(), which would mean that the loop could stop with only part of u.hwrand populated, leading to mix_pool_bytes() injecting uninitialized or already injected bytes instead of fresh b