Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbdFRPqq (ORCPT ); Sun, 18 Jun 2017 11:46:46 -0400 Received: from imap.thunk.org ([74.207.234.97]:41096 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752992AbdFRPqo (ORCPT ); Sun, 18 Jun 2017 11:46:44 -0400 Date: Sun, 18 Jun 2017 11:46:25 -0400 From: "Theodore Ts'o" To: Stephan =?iso-8859-1?Q?M=FCller?= Cc: kernel-hardening@lists.openwall.com, Michael Ellerman , "Jason A. Donenfeld" , Linux Crypto Mailing List , LKML , Greg Kroah-Hartman , David Miller , Eric Biggers Subject: Re: [kernel-hardening] Re: [PATCH v4 13/13] random: warn when kernel uses unseeded randomness Message-ID: <20170618154625.5qu3eduqjtgk5bal@thunk.org> Mail-Followup-To: Theodore Ts'o , Stephan =?iso-8859-1?Q?M=FCller?= , kernel-hardening@lists.openwall.com, Michael Ellerman , "Jason A. Donenfeld" , Linux Crypto Mailing List , LKML , Greg Kroah-Hartman , David Miller , Eric Biggers References: <20170606174804.31124-1-Jason@zx2c4.com> <20170608081919.zbtwdjl32vbvd7jt@thunk.org> <871sqlpl63.fsf@concordia.ellerman.id.au> <1606799.lNpamfCTbW@tauon.chronox.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1606799.lNpamfCTbW@tauon.chronox.de> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1605 Lines: 30 On Thu, Jun 15, 2017 at 01:59:43PM +0200, Stephan M?ller wrote: > I would think that the issue regarding the logging is relevant for > cryptographic use cases or use cases requiring strong random numbers only. > Only those use cases should be fixed eventually to wait for a fully seeded > DRNG. > > The logged messages you present here indicate use cases where no strong > security is required. It looks like that the logs show ASLR related use of > random numbers. Those do not require a fully seeded ChaCha20 DRNG. I suspect there is a range of opinions aobut whether or not ASLR requires strongly secure random numbers or not. It seems pretty clear that if we proposed using prandom_u32 for ASLR, people would object very strongly indeed, since that would make it trivially easy for attackers to circumvent ASLR protections. > IMHO, users using the get_random_u64 or get_random_u32 are use cases that do > not require a fully seeded DRNG thus do not need a cryptographically strong > random number. Hence, I would think that the logging should be removed from > get_random_u32/u64. You are effectively proposing that there ought to be a middle range of security between prandom_32, get_random_u32/get_random_u64 and get_random_bytes(). I think that's going to lead to all sorts of complexity and bugs from people not understanding when they should use get_random_u32 vs get_random_bytes versus prandom_u32. And then we'll end up needing to audit all of the callsites for get_random_u32() so they don't violate this new usage rule that you are proposing. - Ted