From: "Jason A. Donenfeld" Subject: Re: [PATCH v3 05/13] security/keys: ensure RNG is seeded before use Date: Tue, 6 Jun 2017 14:23:09 +0200 Message-ID: References: <20170606005108.5646-1-Jason@zx2c4.com> <20170606005108.5646-6-Jason@zx2c4.com> <26642.1496743729@warthog.procyon.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: "Theodore Ts'o" , Linux Crypto Mailing List , LKML , kernel-hardening@lists.openwall.com, Greg Kroah-Hartman , David Miller , Mimi Zohar , David Safford To: David Howells Return-path: Received: from frisell.zx2c4.com ([192.95.5.64]:54593 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751345AbdFFMXN (ORCPT ); Tue, 6 Jun 2017 08:23:13 -0400 In-Reply-To: <26642.1496743729@warthog.procyon.org.uk> Sender: linux-crypto-owner@vger.kernel.org List-ID: On Tue, Jun 6, 2017 at 12:08 PM, David Howells wrote: > Jason A. Donenfeld wrote: > >> + key->serial = get_random_u32() >> 1; > > If this may sleep, it must be interruptible. That won't sleep. I could have made it get_random_u32_wait(), but we'd get into trouble at boottime. So instead, for now, I just use get_random_u32 rather than get_random_bytes, which can use the architectural random number generator, when the platform has one, which is available early on.