Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752955AbdFRTLa (ORCPT ); Sun, 18 Jun 2017 15:11:30 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:44999 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbdFRTL1 (ORCPT ); Sun, 18 Jun 2017 15:11:27 -0400 MIME-Version: 1.0 In-Reply-To: <20170618154625.5qu3eduqjtgk5bal@thunk.org> References: <20170606174804.31124-1-Jason@zx2c4.com> <20170608081919.zbtwdjl32vbvd7jt@thunk.org> <871sqlpl63.fsf@concordia.ellerman.id.au> <1606799.lNpamfCTbW@tauon.chronox.de> <20170618154625.5qu3eduqjtgk5bal@thunk.org> From: "Jason A. Donenfeld" Date: Sun, 18 Jun 2017 21:11:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [kernel-hardening] Re: [PATCH v4 13/13] random: warn when kernel uses unseeded randomness To: "Theodore Ts'o" , =?UTF-8?Q?Stephan_M=C3=BCller?= , kernel-hardening@lists.openwall.com, Michael Ellerman , "Jason A. Donenfeld" , Linux Crypto Mailing List , LKML , Greg Kroah-Hartman , David Miller , Eric Biggers Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 786 Lines: 16 On Sun, Jun 18, 2017 at 5:46 PM, Theodore Ts'o wrote: > 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. I agree with you wholeheartedly. get_random_* provides the secure random numbers. prandom_* provides the insecure random numbers. Introducing some kind of middle ground will result in needless complexity and inevitable bugs.