[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y3axaspOlt/oEDhw@zx2c4.com>
Date: Thu, 17 Nov 2022 23:10:50 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Kees Cook <keescook@...omium.org>
Cc: linux-kernel@...r.kernel.org, patches@...ts.linux.dev,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jakub Kicinski <kuba@...nel.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Heiko Carstens <hca@...ux.ibm.com>,
Herbert Xu <herbert@...dor.apana.org.au>,
Christoph Böhmwalder
<christoph.boehmwalder@...bit.com>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Jason Gunthorpe <jgg@...dia.com>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
"Martin K . Petersen" <martin.petersen@...cle.com>,
Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Jaegeuk Kim <jaegeuk@...nel.org>,
Richard Weinberger <richard@....at>,
"Darrick J . Wong" <djwong@...nel.org>,
SeongJae Park <sj@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Andrew Morton <akpm@...ux-foundation.org>,
Michael Ellerman <mpe@...erman.id.au>,
Helge Deller <deller@....de>, netdev@...r.kernel.org,
linux-crypto@...r.kernel.org, linux-block@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-media@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, loongarch@...ts.linux.dev,
linux-mips@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-mmc@...r.kernel.org, linux-parisc@...r.kernel.org
Subject: Re: [PATCH v3 3/3] treewide: use get_random_u32_inclusive() when
possible
On Thu, Nov 17, 2022 at 01:57:13PM -0800, Kees Cook wrote:
> The only comment I have is that maybe these cases can just be left as-is
> with _below()?
>
> > - size_t len = get_random_u32_below(rs) + gs;
> > + size_t len = get_random_u32_inclusive(gs, rs + gs - 1);
>
> It seems like writing it in the form of base plus [0, limit) is clearer?
>
> size_t len = gs + get_random_u32_below(rs);
>
> But there is only a handful, so *shrug*
Okay, I'll drop that one.
Jason
Powered by blists - more mailing lists