lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ea4c44c8-a6f1-dac2-7cf8-a1a0443a39f0@redhat.com>
Date:   Fri, 8 Feb 2019 08:14:45 -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/4/19 10:55 AM, Theodore Y. Ts'o wrote:
> On Sun, Feb 03, 2019 at 08:09:37AM -0500, Prarit Bhargava wrote:
>> 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.
> 
> Sometimes the warnings are real, and shouldn't be suppressed.  A
> Debian maintainer once tried to suppress a compile-time warning, and
> it was disastrous for security.  :-)
> 
> What line number is that corresponding to?  It sounds like something
> is trying to use get_random_bytes() before the random driver was
> initialized, and so the first question is does it really need to call
> get_random_bytes() then or can it be moved?
> 

Yes, that's exactly the case.  During early boot we initialize the boot cpu's
stack canary at arch/x86/include/asm/stackprotector.h:75 which is well before
the random driver is initialized.  The same code is called for all other cpus,
so perhaps not calling get_random_bytes() for the boot cpu is another option.

>>> 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.
> 
> But we don't *rely* on it.  That's a big difference.

Perhaps I'm confusing you by changing the comment.  I'm not changing any
behaviour wrt TSC.  The current code "relies" on the TSC as much as it did
before (all the way back through the git history).

P.

> 
>        	     	       	    	     - Ted
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ