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 1012EC4332F for ; Wed, 14 Dec 2022 18:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238693AbiLNS3A (ORCPT ); Wed, 14 Dec 2022 13:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238586AbiLNS27 (ORCPT ); Wed, 14 Dec 2022 13:28:59 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04A34F58D for ; Wed, 14 Dec 2022 10:28:57 -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: bpf@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 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64A03C4332F for ; Wed, 14 Dec 2022 18:35:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2B2F10E445; Wed, 14 Dec 2022 18:35:51 +0000 (UTC) X-Greylist: delayed 307 seconds by postgrey-1.36 at gabe; Wed, 14 Dec 2022 18:35:47 UTC Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55A5910E445 for ; Wed, 14 Dec 2022 18:35:47 +0000 (UTC) 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 2BEISlXT001166 (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=1671042536; bh=yBGs7uN391IpXsrDxRmFEUWTGiaryut5x17IYCOizWk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HX6AQcpAe2+cnC9hTYUfjgWkeHvv1LC4w/UQdsttxATAAzgnydZDPh4r2DWcplfoJ 1vqfTJhD0abDlckLtoPygUetxakA9e9fRup+4tlH05DU68oXBxET8mmwotIvCYfECK 5HKu/wcqn8EMkAfuyRTI/bTHXL0PNK49CEUvPdQcr84OeW3+kU7SNVZA4+qSirbgTJ 3NhaGD5fFBRmef7EqggKdRJ9UhouLLoXZkFyO2r38pU9KYN0rZMddpmYclbj9loR82 34hoQmvSNu0DID1RNOJGFVguRqDJF66nyblzlr2E5grx3vdYOtphrf56UdcYP5B82p HiaEQY2wnNKaQ== 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 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> Subject: Re: [Intel-gfx] [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason A. Donenfeld" , Vignesh Raghavendra , Peter Zijlstra , Roman Gushchin , Rasmus Villemoes , Alexei Starovoitov , dri-devel@lists.freedesktop.org, Song Liu , Eric Dumazet , 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 , Jiri Pirko , David Rientjes , Yonghong Song , Paolo Abeni , intel-gfx@lists.freedesktop.org, Petr Mladek , david.keisarschm@mail.huji.ac.il, Dave Hansen , Hao Luo , Miquel Raynal , "James E.J. Bottomley" , Andrew Morton , Steven Rostedt , KP Singh , Rodrigo Vivi , Borislav Petkov , Hannes Reinecke , Andy Lutomirski , Jakub Kicinski , Thomas Gleixner , Andy Shevchenko , bpf@vger.kernel.org, Vlastimil Babka , 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 , Joonsoo Kim , Martin KaFai Lau , "David S. Miller" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 20BEEC4167B for ; Wed, 14 Dec 2022 18:30:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OTp+uoy8kX16XNcHP0qcMXOvZnuECZd1uTg/J/q/QtQ=; b=bnNkIGjmuGPW5g iTbTRp3KBkfyyR8TDQUtjvXhvO2MafqAHKnkUQr4y1sRc+ZeCf0szfdcz+/pbYYbXsOG5Igi/mk/Z rDEEiiSx+/s4WDihwojM8+Wu5nPFVvRItPaLCEq/lYNJldCTyEua9ifFmYvqaDd2tbs0cZSOuk9Db g6tBGHU7WH5R0VTn/fZYgnTcTyUwnL5iQUQct6wftqgr/k3hecwntztKTjETdkQ2gvRy7+iAqLxMw bOCw/B7iFGGFFflRcGVwVic66zlb/sFIgRofgq3QB4/k6bIwLQOGRsNIZVTi/ePMpNsGB5WePvrNo su6JWTOvqr57NbvLTvRw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5WWi-001de8-QA; Wed, 14 Dec 2022 18:30:44 +0000 Received: from outgoing-auth-1.mit.edu ([18.9.28.11] helo=outgoing.mit.edu) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p5WWf-001dbi-Qw for linux-mtd@lists.infradead.org; Wed, 14 Dec 2022 18:30:43 +0000 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 2BEISlXT001166 (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=1671042536; bh=yBGs7uN391IpXsrDxRmFEUWTGiaryut5x17IYCOizWk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HX6AQcpAe2+cnC9hTYUfjgWkeHvv1LC4w/UQdsttxATAAzgnydZDPh4r2DWcplfoJ 1vqfTJhD0abDlckLtoPygUetxakA9e9fRup+4tlH05DU68oXBxET8mmwotIvCYfECK 5HKu/wcqn8EMkAfuyRTI/bTHXL0PNK49CEUvPdQcr84OeW3+kU7SNVZA4+qSirbgTJ 3NhaGD5fFBRmef7EqggKdRJ9UhouLLoXZkFyO2r38pU9KYN0rZMddpmYclbj9loR82 34hoQmvSNu0DID1RNOJGFVguRqDJF66nyblzlr2E5grx3vdYOtphrf56UdcYP5B82p HiaEQY2wnNKaQ== 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-Disposition: inline In-Reply-To: <20221214162117.GC1062210@linux.intel.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221214_103042_043944_5303250A X-CRM114-Status: GOOD ( 19.40 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.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 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C7C0BC4332F for ; Wed, 14 Dec 2022 18:36:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B5A910E447; Wed, 14 Dec 2022 18:35:54 +0000 (UTC) X-Greylist: delayed 307 seconds by postgrey-1.36 at gabe; Wed, 14 Dec 2022 18:35:47 UTC Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by gabe.freedesktop.org (Postfix) with ESMTPS id C64B210E446 for ; Wed, 14 Dec 2022 18:35:47 +0000 (UTC) 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 2BEISlXT001166 (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=1671042536; bh=yBGs7uN391IpXsrDxRmFEUWTGiaryut5x17IYCOizWk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=HX6AQcpAe2+cnC9hTYUfjgWkeHvv1LC4w/UQdsttxATAAzgnydZDPh4r2DWcplfoJ 1vqfTJhD0abDlckLtoPygUetxakA9e9fRup+4tlH05DU68oXBxET8mmwotIvCYfECK 5HKu/wcqn8EMkAfuyRTI/bTHXL0PNK49CEUvPdQcr84OeW3+kU7SNVZA4+qSirbgTJ 3NhaGD5fFBRmef7EqggKdRJ9UhouLLoXZkFyO2r38pU9KYN0rZMddpmYclbj9loR82 34hoQmvSNu0DID1RNOJGFVguRqDJF66nyblzlr2E5grx3vdYOtphrf56UdcYP5B82p HiaEQY2wnNKaQ== 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 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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Jason A. Donenfeld" , Vignesh Raghavendra , Peter Zijlstra , Roman Gushchin , Rasmus Villemoes , Alexei Starovoitov , dri-devel@lists.freedesktop.org, Song Liu , Eric Dumazet , 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 , Jiri Pirko , David Rientjes , Yonghong Song , Paolo Abeni , intel-gfx@lists.freedesktop.org, Petr Mladek , david.keisarschm@mail.huji.ac.il, Dave Hansen , Hao Luo , Miquel Raynal , "James E.J. Bottomley" , Andrew Morton , Steven Rostedt , KP Singh , Rodrigo Vivi , Borislav Petkov , Hannes Reinecke , Andy Lutomirski , Jakub Kicinski , Thomas Gleixner , Andy Shevchenko , bpf@vger.kernel.org, Vlastimil Babka , Tvrtko Ursulin , 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 , Joonsoo Kim , Martin KaFai Lau , "David S. Miller" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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