Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp758352qtx; Thu, 17 Nov 2022 07:44:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6U6YPsXfIeNX9E9mJxN6oKaKxHCaG9ZkAFyKPyNE4SUjFoT1sBBi6VXCWRZKKN20luEqT3 X-Received: by 2002:a17:902:e8ca:b0:186:9c70:9b7d with SMTP id v10-20020a170902e8ca00b001869c709b7dmr3328143plg.3.1668699887404; Thu, 17 Nov 2022 07:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668699887; cv=none; d=google.com; s=arc-20160816; b=F/OWOOu0ZG+xljg8YV3zx7tHG4i4Gdj+ZaYJLkkP70liVrqpRY0bSUNuzLozNaapHN xR6W52mXldmCs03rzT/wvVnz9r99Q+IvnofbhdvAc0kqkHH4k7etc7x+6T3FbhY08aQL mvNr6ePnqqrpZU05unq0mbSRHSYIUWzVjjN9wGwvv4A2ApUArUfE99oqEHCPR8N/2MNw pT/Nwn8eIGsSEv9XMAAso5Ae+kI8hC502SFW/I3lGrx2ZYJomxkGpiLle3FvPdPG406W xgHOFHd6rZvtgW8p8sUh+OhexamSqZZD7El9fmFqL72gwAeMmOWw0XkZUTUzuyrDiYiD jq7w== 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=Z8eRjDyW5LkCGXRIWQ/ehJoBTxfA+rKV6G90HV/lnfI=; b=c97GcH2GkX4DLzZlYsit2ajtppNelknX3L6VMJ15XL0kmwhmzPcmUDw7egLJQeCEYp 1vGQ10LiFceLj7vlv166hJGtmjUaGmjIALUmszdCuyI6UkmXUiD75bKBH5R4Abwu4yK8 kcMnkcy9Oy6klcfnCGjHM22tRMQtvAHpVijsVfYLE2PVGsYFZ7trT8okYCTCTIHwMyR/ GRB/aKumPDdO9sKdjNnYkQN3Tnw9Ya6V2Yk1K21SPwKwIV5c6s70g4K55jSX5XCdmPkr 6FUK/yDdiXORnUjQol/QhFtzGOz0qjy1UBToPg+w4ZQCVrMDx0aBGynGwYy6FhjtCXDW linw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mit.edu header.s=outgoing header.b=a5RGA55J; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 h184-20020a636cc1000000b00476d0c7b644si1180980pgc.290.2022.11.17.07.44.28; Thu, 17 Nov 2022 07:44:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-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=a5RGA55J; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-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 S234844AbiKQPoZ (ORCPT + 99 others); Thu, 17 Nov 2022 10:44:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234811AbiKQPoY (ORCPT ); Thu, 17 Nov 2022 10:44:24 -0500 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7630B5FC6; Thu, 17 Nov 2022 07:44:21 -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 2AHFgbpU025691 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Nov 2022 10:42:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1668699767; bh=Z8eRjDyW5LkCGXRIWQ/ehJoBTxfA+rKV6G90HV/lnfI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=a5RGA55J01HygsEqMJNP2VrZPtI8ZaGUHt2dY2LY5wF8DMtynBL3gxe4ssBSltxUc tGBtVlIBAOfcvHXP8OxNBxX/rSKyMd0+qgQqEihqLCmIIT5R91T0BV2UToxLFXN9NK qLPI7qFXLd4XspU67nh5HMMeBw4NAJ1ReJokdr95mAlk7ege100zyHPP5eUMyPQkdJ 2J/DoKBr5ulEfGsbUWpt2b/Jh4Fgk8Q/WSHSBEMDxX6G3lCTA/GKgvoNGo91ao1O85 B0gVxshfsoXUb4HsVOvv2uuEHdk9gVaKkI7GIFJ0/jwX2DtNAGU82pYQXeJCXpebQn 9YTcylqtbCwyg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 2CB0415C34C3; Thu, 17 Nov 2022 10:42:37 -0500 (EST) Date: Thu, 17 Nov 2022 10:42:37 -0500 From: "Theodore Ts'o" To: Kees Cook Cc: "Jason A. Donenfeld" , Kees Cook , linux-kernel@vger.kernel.org, patches@lists.linux.dev, Greg Kroah-Hartman , Jakub Kicinski , Russell King , Catalin Marinas , Thomas Bogendoerfer , Heiko Carstens , Herbert Xu , Christoph =?iso-8859-1?Q?B=F6hmwalder?= , Jani Nikula , Jason Gunthorpe , Sakari Ailus , "Martin K . Petersen" , Andreas Dilger , Jaegeuk Kim , Richard Weinberger , "Darrick J . Wong" , SeongJae Park , Thomas Gleixner , Andrew Morton , Michael Ellerman , Helge Deller , netdev@vger.kernel.org, linux-crypto@vger.kernel.org, linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mmc@vger.kernel.org, linux-parisc@vger.kernel.org, ydroneaud@opteya.com Subject: Re: [PATCH v2 3/3] treewide: use get_random_u32_between() when possible Message-ID: References: <20221114164558.1180362-1-Jason@zx2c4.com> <20221114164558.1180362-4-Jason@zx2c4.com> <202211161436.A45AD719A@keescook> <202211161628.164F47F@keescook> <0EE39896-C7B6-4CB6-87D5-22AA787740A9@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0EE39896-C7B6-4CB6-87D5-22AA787740A9@kernel.org> 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=ham 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-crypto@vger.kernel.org On Wed, Nov 16, 2022 at 04:47:27PM -0800, Kees Cook wrote: > >> > - between > >> > - ranged > >> > - spanning > >> > > >> > https://www.thefreedictionary.com/List-of-prepositions.htm > >> > - amid > >> > > >> > Sigh, names. > >> > >> I think "inclusive" is best. > > > >I find it not very descriptive of what the function does. Is there one > >you like second best? Or are you convinced they're all much much much > >worse than "inclusive" that they shouldn't be considered? > > Right, I don't think any are sufficiently descriptive. "Incluisve" > with two arguments seems unambiguous and complete to me. :) The problem with "between", "ranged", "spanning" is that they don't tell the reader whether we're dealing with an "open interval" or a "closed interval". They are just different ways of saying that it's a range between, say, 0 and 20. But it doesn't tell you whether it includes 0 or 20 or not. The only way I can see for making it ambiguous is either to use the terminology "closed interval" or "inclusive". And "open" and "closed" can have other meanings, so get_random_u32_inclusive() is going to be less confusing than get_random_u32_closed(). Cheers, - Ted