From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2499C4332F for ; Wed, 14 Dec 2022 18:29:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238712AbiLNS3D (ORCPT ); Wed, 14 Dec 2022 13:29:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48926 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238688AbiLNS3A (ORCPT ); Wed, 14 Dec 2022 13:29:00 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6BB70FCD8 for ; Wed, 14 Dec 2022 10:28:59 -0800 (PST) Received: from cwcc.thunk.org (pool-173-48-120-46.bstnma.fios.verizon.net [173.48.120.46]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 2BEISlEt001171 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Dec 2022 13:28:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1671042531; bh=yBGs7uN391IpXsrDxRmFEUWTGiaryut5x17IYCOizWk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=iTvQW2ZcZl/RaloFVFvof3Xa5t0qJOPMbf9tEe1ZxUY/ml5As1AyeT37tSuPOcGw+ 17vCGhEEjx9LOnZs3GLmkDSXWr8W/CTALV2Vj0BYRVQmlX/+14VYvEZc9cLvJWdXVL 9oIQx2LCrwfMWPFmSCPXfT4Hv2/oosDrkhOpQHhPv+0hz9gFTJV7qyI/FWZGTrENN7 84ztbhtlutCuVHyOA0sewiP3fT74UfRtl1dIyLBRPrb4K2WVewrJxycNUFMnma8otO XQPs5XLQapq5t8UKt6SRlcg5Vr1Ov6Ww0fAJCCZS9NV3kc3QPwS8c73yxGFZtDnfx+ ysY4rmQix2LxQ== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 615B615C40A2; Wed, 14 Dec 2022 13:28:47 -0500 (EST) Date: Wed, 14 Dec 2022 13:28:47 -0500 From: "Theodore Ts'o" To: Stanislaw Gruszka Cc: Eric Dumazet , "Jason A. Donenfeld" , Vignesh Raghavendra , Peter Zijlstra , Joonsoo Kim , Roman Gushchin , Rasmus Villemoes , Alexei Starovoitov , dri-devel@lists.freedesktop.org, Song Liu , linux-mtd@lists.infradead.org, Stanislav Fomichev , "H. Peter Anvin" , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Christoph Lameter , Daniel Borkmann , Richard Weinberger , x86@kernel.org, John Fastabend , Andrii Nakryiko , ilay.bahat1@gmail.com, Ingo Molnar , David Rientjes , Yonghong Song , Paolo Abeni , "James E.J. Bottomley" , Petr Mladek , david.keisarschm@mail.huji.ac.il, Dave Hansen , Tvrtko Ursulin , Miquel Raynal , intel-gfx@lists.freedesktop.org, Steven Rostedt , KP Singh , Jakub Kicinski , Rodrigo Vivi , Borislav Petkov , Hannes Reinecke , Andy Lutomirski , Jiri Pirko , Thomas Gleixner , Andy Shevchenko , bpf@vger.kernel.org, Vlastimil Babka , Hao Luo , linux-scsi@vger.kernel.org, "Martin K. Petersen" , linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Pekka Enberg , Sergey Senozhatsky , aksecurity@gmail.com, Jiri Olsa , Andrew Morton , Martin KaFai Lau , "David S. Miller" Subject: Re: [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state Message-ID: References: <20221214123358.GA1062210@linux.intel.com> <20221214162117.GC1062210@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221214162117.GC1062210@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 14, 2022 at 05:21:17PM +0100, Stanislaw Gruszka wrote: > On Wed, Dec 14, 2022 at 04:15:49PM +0100, Eric Dumazet wrote: > > On Wed, Dec 14, 2022 at 1:34 PM Stanislaw Gruszka > > wrote: > > > > > > On Mon, Dec 12, 2022 at 03:35:20PM +0100, Jason A. Donenfeld wrote: > > > > Please CC me on future revisions. > > > > > > > > As of 6.2, the prandom namespace is *only* for predictable randomness. > > > > There's no need to rename anything. So nack on this patch 1/5. > > > > > > It is not obvious (for casual developers like me) that p in prandom > > > stands for predictable. Some renaming would be useful IMHO. I disagree. pseudo-random has *always* menat "predictable". And the 'p' in prandom was originally "pseudo-random". In userspace, random(3) is also pseudo-random, and is ***utterly*** predictable. So the original use of prandom() was a bit more of an explicit nod to the fact that prandom is something which is inherently predictable. So I don't think it's needed to rename it, whether it's to "predictable_rng_prandom_u32", or "no_you_idiot_dont_you_dare_use_it_for_cryptographi_purposes_prandom_u32". I think we need to assume a certain base level of competence, especially for someone who is messing with security psensitive kernel code. If a developer doesn't know that a prng is predictable, that's probably the *least* of the sort of mistakes that they might make. - Ted