Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-08 Thread Jason A. Donenfeld
On Sat, Oct 08, 2022 at 09:53:33PM +, David Laight wrote: > From: Jason A. Donenfeld > > Sent: 07 October 2022 18:56 > ... > > > Given these kinds of less mechanical changes, it may make sense to split > > > these from the "trivial" conversions in a treewide patch. The chance of > > > needing

RE: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-08 Thread David Laight
From: Jason A. Donenfeld > Sent: 07 October 2022 18:56 ... > > Given these kinds of less mechanical changes, it may make sense to split > > these from the "trivial" conversions in a treewide patch. The chance of > > needing a revert from the simple 1:1 conversions is much lower than the > > need

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread Jason A. Donenfeld
On Fri, Oct 07, 2022 at 10:12:42AM -0700, Kees Cook wrote: > On Fri, Oct 07, 2022 at 08:07:58AM -0600, Jason A. Donenfeld wrote: > > On Fri, Oct 07, 2022 at 04:57:24AM +, Christophe Leroy wrote: > > > > > > > > > Le 07/10/2022 à 01:36, Jason A. Donenfeld a écrit : > > > > On 10/6/22,

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread Kees Cook
On Fri, Oct 07, 2022 at 08:07:58AM -0600, Jason A. Donenfeld wrote: > On Fri, Oct 07, 2022 at 04:57:24AM +, Christophe Leroy wrote: > > > > > > Le 07/10/2022 à 01:36, Jason A. Donenfeld a écrit : > > > On 10/6/22, Christophe Leroy wrote: > > >> > > >> > > >> Le 06/10/2022 à 19:31,

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread Jason A. Donenfeld
On Fri, Oct 07, 2022 at 04:57:24AM +, Christophe Leroy wrote: > > > Le 07/10/2022 à 01:36, Jason A. Donenfeld a écrit : > > On 10/6/22, Christophe Leroy wrote: > >> > >> > >> Le 06/10/2022 à 19:31, Christophe Leroy a écrit : > >>> > >>> > >>> Le 06/10/2022 à 19:24, Jason A. Donenfeld a

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread Mika Westerberg
On Thu, Oct 06, 2022 at 10:53:44AM -0600, Jason A. Donenfeld wrote: > drivers/thunderbolt/xdomain.c | 2 +- Acked-by: Mika Westerberg

RE: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread David Laight
From: Christophe Leroy > Sent: 06 October 2022 18:43 ... > But taking into account that sp must remain 16 bytes aligned, would it > be better to do something like ? > > sp -= prandom_u32_max(PAGE_SIZE >> 4) << 4; That makes me think... If prandom_u32_max() is passed a (constant) power of 2

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread Christophe Leroy
Le 07/10/2022 à 01:36, Jason A. Donenfeld a écrit : > On 10/6/22, Christophe Leroy wrote: >> >> >> Le 06/10/2022 à 19:31, Christophe Leroy a écrit : >>> >>> >>> Le 06/10/2022 à 19:24, Jason A. Donenfeld a écrit : Hi Christophe, On Thu, Oct 6, 2022 at 11:21 AM Christophe Leroy

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-07 Thread Jason A. Donenfeld
On 10/6/22, Christophe Leroy wrote: > > > Le 06/10/2022 à 19:31, Christophe Leroy a écrit : >> >> >> Le 06/10/2022 à 19:24, Jason A. Donenfeld a écrit : >>> Hi Christophe, >>> >>> On Thu, Oct 6, 2022 at 11:21 AM Christophe Leroy >>> wrote: Le 06/10/2022 à 18:53, Jason A. Donenfeld a écrit :

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Christophe Leroy
Le 06/10/2022 à 19:31, Christophe Leroy a écrit : Le 06/10/2022 à 19:24, Jason A. Donenfeld a écrit : Hi Christophe, On Thu, Oct 6, 2022 at 11:21 AM Christophe Leroy wrote: Le 06/10/2022 à 18:53, Jason A. Donenfeld a écrit : The prandom_u32() function has been a deprecated inline

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Christophe Leroy
Le 06/10/2022 à 19:24, Jason A. Donenfeld a écrit : > Hi Christophe, > > On Thu, Oct 6, 2022 at 11:21 AM Christophe Leroy > wrote: >> Le 06/10/2022 à 18:53, Jason A. Donenfeld a écrit : >>> The prandom_u32() function has been a deprecated inline wrapper around >>> get_random_u32() for several

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld
Hi Christophe, On Thu, Oct 6, 2022 at 11:21 AM Christophe Leroy wrote: > Le 06/10/2022 à 18:53, Jason A. Donenfeld a écrit : > > The prandom_u32() function has been a deprecated inline wrapper around > > get_random_u32() for several releases now, and compiles down to the > > exact same code.

Re: [PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Christophe Leroy
Le 06/10/2022 à 18:53, Jason A. Donenfeld a écrit : > The prandom_u32() function has been a deprecated inline wrapper around > get_random_u32() for several releases now, and compiles down to the > exact same code. Replace the deprecated wrapper with a direct call to > the real function. The same

[PATCH v3 3/5] treewide: use get_random_u32() when possible

2022-10-06 Thread Jason A. Donenfeld
The prandom_u32() function has been a deprecated inline wrapper around get_random_u32() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. The same also applies to get_random_int(), which is just a wrapper