[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4adb711f-f81e-31ef-c581-4d5ecc739bd1@redhat.com>
Date: Sun, 3 Feb 2019 08:09:37 -0500
From: Prarit Bhargava <prarit@...hat.com>
To: "Theodore Y. Ts'o" <tytso@....edu>, 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 2/1/19 10:02 PM, Theodore Y. Ts'o wrote:
> 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".
>
Ted, the bug I'm trying to fix is the warning:
random: get_random_bytes called from start_kernel+0x8e/0x587 with crng_init=0
during early boot. Even with the kernel parameter the warning appears.
> Also, relying on the TSC for entropy is not something we should be
> recommending.
The current code uses the TSC. It is not something new I'm introducing.
P.
>
> So, NAK.
>
> - Ted
>
Powered by blists - more mailing lists