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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10775C4332F for ; Wed, 14 Dec 2022 18:30:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E91268E0003; Wed, 14 Dec 2022 13:30:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E1A318E0002; Wed, 14 Dec 2022 13:30:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CBAAF8E0003; Wed, 14 Dec 2022 13:30:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id B8BA18E0002 for ; Wed, 14 Dec 2022 13:30:05 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 704B1160609 for ; Wed, 14 Dec 2022 18:30:05 +0000 (UTC) X-FDA: 80241751170.29.350C436 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by imf07.hostedemail.com (Postfix) with ESMTP id E4EFE4000D for ; Wed, 14 Dec 2022 18:30:03 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=fail ("headers rsa verify failed") header.d=mit.edu header.s=outgoing header.b=HX6AQcpA; spf=pass (imf07.hostedemail.com: domain of tytso@mit.edu designates 18.9.28.11 as permitted sender) smtp.mailfrom=tytso@mit.edu; dmarc=pass (policy=none) header.from=mit.edu ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1671042604; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=yBGs7uN391IpXsrDxRmFEUWTGiaryut5x17IYCOizWk=; b=cXZHn9AuTe9boGITH39Po7+xnbbRBs2lwz/Yop4WklgyadnFzUZT314KuwMoF97XcZ1Xd6 tk4AAz3RSQjMM2tETHMFoScMBWgD/XDYY+mUqgb4CiEp1NwbbIl+H5EKXyOuhAowEMoq2e tcdNlIgPddcQ6ZILSEhJNy/8TeK0Y5c= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=fail ("headers rsa verify failed") header.d=mit.edu header.s=outgoing header.b=HX6AQcpA; spf=pass (imf07.hostedemail.com: domain of tytso@mit.edu designates 18.9.28.11 as permitted sender) smtp.mailfrom=tytso@mit.edu; dmarc=pass (policy=none) header.from=mit.edu ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1671042604; a=rsa-sha256; cv=none; b=TqsVx9l0EnROoloWabrNz99/3WDzVDNZ5XPE2GlnCkvk6OsRbQO1D84CuJTddA74Iiv4rY wJ7wvreZjrEmHxxCgCsnklY+H+KpGly+uQX0fGwQ/k6JD+ZzQqM0vWmPBNk0vfeN5bCuLM 6PL6sMa6PlW+uXniW8MGnbTUp7n8xTg= 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221214162117.GC1062210@linux.intel.com> X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: E4EFE4000D X-Rspam-User: X-Stat-Signature: ope6xjuoj4towzm9h58scjhdw59bwfnk X-HE-Tag: 1671042603-292427 X-HE-Meta: U2FsdGVkX19VeGtdW9AGfINNhTwYmN3Ac9mTN06F6FxxscRuv0zbVUwyhC9c4xtyL8CqRDF/DMDW+HgGkey1nprR0Z/66YwuoI0I1D5K51IGx8Gyr8QSRYq/tWq4pw7twtImjGK1XLj5ukCckVZpP6YrpUVlTga8Qf+rV1dl2NEtV2KfyCIjgF5dDND/nPwwrkDIq2YFcuixiVsqQQ4k7Edx6guIufG5WHnxR+dLxm2wjE1IoB3koO5gyfiYEy7sjR6L+gC8clRVCr+rhungxbvOLTdgCRXsZhyPF5do+0YoSzT0XCbdgXIbKN6A3FwQW1NJYJ/BKSbQNwvyUUU/UljKj+poreLGtqXhvbScu1afcStFH5/dey/hlJNl2mqZ276utNrSciGZtTBop5kSSMewsebenCdHAcpA4x+M/wCv6+jLp09pH/geHX+lojNium4Xyuv3UTySB9coHZrI3ibiwFZkOvbxmdeIT01CkZmfs0Z3Cif1e5C45Ihs2+6GUgLvSkWNoG3cw4dA1/5fpO1vq1adL/OVNPuGSRUZ8xQfiA6kNSq3G5tYF8FDjBT9suLzgqoBha8PEIkajlpNvAjPebXzTy4VEQSrTHjZUtVPjJ1FPnCoa10SzyeOsbi7SI5XP3K97XaihOnaqZVQhEnIyHiXgOpA8AOcdxavHq++oDCd3jcVhzgfdi0AJWj0J4ig9/FKT09tNbjldUOy1FTbdoZ+pfnaDqLNnJDzV4QqoOVcqrKX5VmwHVltGO6oKRS9mD85eznc5QZMevyM5C8xMGVSZ2MsiZI1dVMWN+gxG+FTRKjiRulj7YnjGNDn0QS0qhPWgkj4Ovg40nvQ8HlR7Sx+8Ot7iM+giQzjlneFAkquMecnB/gJgzHFQiDsfCMvnE7rPhkbiHbsuyo02tozMDDG5Bq1xqGIcRVGb0y7W+SqYuukC1hF2xXcNC8f/ZFLZrXOgAM5Qhir8x6 4rkHWBo2 bM4/bG45BmAXekasDOM7QNfu+YYgEgYA5diGDvYgg5Xv5jFjKJn64tmrCNw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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