[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 1 Feb 2019 22:02:40 -0500
From: "Theodore Y. Ts'o" <tytso@....edu>
To: Prarit Bhargava <prarit@...hat.com>
CC: <linux-kernel@...r.kernel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, <x86@...nel.org>,
Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Rik van Riel <riel@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Philippe Ombredanne <pombredanne@...b.com>,
Kees Cook <keescook@...omium.org>,
"Jason A. Donenfeld" <Jason@...c4.com>,
Kate Stewart <kstewart@...uxfoundation.org>
Subject: Re: [PATCH v2] x86, random: Fix get_random_bytes() warning in x86
start_kernel
On Fri, Feb 01, 2019 at 01:08:31PM -0500, Prarit Bhargava wrote:
> After 43838a23a05f ("random: fix crng_ready() test") early boot calls to
> get_random_bytes() will warn on x86 because the crng is not initialized.
> For example,
>
> random: get_random_bytes called from start_kernel+0x8e/0x587 with crng_init=0
>
> x86 only uses get_random_bytes() for better randomization of the stack
> canary value so the warning is of no consequence.
>
> Test if the crng is initialized before calling get_random_bytes(). If it
> is not available then attempt to read from the hardware random generator,
> before finally using the TSC.
If you want to trust the CPU's hardware number generator, there is a
way to do this already. Simply enable CONFIG_RANDOM_TRUST_CPU, or set
the boot command line option "random.trust_cpu=on".
Also, relying on the TSC for entropy is not something we should be
recommending.
So, NAK.
- Ted
Powered by blists - more mailing lists