Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1510396rwb; Wed, 14 Dec 2022 11:04:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6vq4Qw9fqMaE8IA/0X6erecnwmNTGbA2wQ0uiYoz3dXcQcmgWUtjVwd+mtj9we1DbHCQYK X-Received: by 2002:a17:906:2284:b0:7c0:4030:ae20 with SMTP id p4-20020a170906228400b007c04030ae20mr22640542eja.24.1671044655873; Wed, 14 Dec 2022 11:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671044655; cv=none; d=google.com; s=arc-20160816; b=Ki9bv88GEkhfQDVGUk53pFkjFRkC14Do3ij1j/HbVL34WCiHG/nJXtHExu5LFJhEfx a4tL/6fGOVUp0122dC79S5qwRjHIWL5P5jHmRnFJedGUpMBAwtQn9wE6fPN2l4GNde2M MNvvegZp/GfcRnAna1GGX7vfC7b+d8dhpc6zhnkqMMCxHpmXsAyX97atBvyFjTPF0uhx Mem1yHcjwdrRlx3IowAs7JyD+IS6LaqGW42XwMGTdoQMEOyBPQnIFsP4zj9FIX7z6VEx mqTx4ggif0o5ypMVS5EPPEW/okV8Z9Yi+2RsnMeh9OrI2mk1d49Qd8IXzxxVTluMo0gd avoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=yBGs7uN391IpXsrDxRmFEUWTGiaryut5x17IYCOizWk=; b=j4HltyDQfJEoOvjhVMStNqWgCo5YhUMw1HAWgRkP+yXaD+6mVQhyhZSjAQDAL9pB9U KvIC+Js+6vlIxjCYrtEtOM0VpBube7FT+oMlxutKUeBFaY2f28+vT1moMAOhyA78L3OX VARdqDydZeZx78uOSzaE0mRiuIhW+2Kyp8HfTcH5ZIb0ZVIrdO15UMA99IgejccFsOC0 Plyn2U1mmwa3VNeQbTTb4X+9nKJ3HXFCgjKnZ5ujxCn3T8eMkeQx3BzpBMKoAkXu1frS QYMxmhUeLfumYbGXZy1mEKUprE3scsoVQv3AiG2rjFzGCu0DjwqoD1eaUYWlRax0Tmet nIMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=iTvQW2Zc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h26-20020a1709070b1a00b007ba49ec6d3bsi11315256ejl.390.2022.12.14.11.03.53; Wed, 14 Dec 2022 11:04:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=iTvQW2Zc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238825AbiLNS3D (ORCPT + 69 others); 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> X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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