lkml.org 
[lkml]   [2022]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] Replace invocation of weak PRNG in mm/slab.c
On Tue, Dec 13, 2022 at 12:34:57PM +0200, david.keisarschm@mail.huji.ac.il wrote:
> From: David <david.keisarschm@mail.huji.ac.il>

It's normal to include the surname in your sign-off, fwiw.

> @@ -2447,7 +2443,7 @@ static bool shuffle_freelist(struct kmem_cache *cachep, struct slab *slab)
>
> /* Fisher-Yates shuffle */
> for (i = count - 1; i > 0; i--) {
> - rand = prandom_u32_state(&state.rnd_state);
> + rand = get_random_u32();
> rand %= (i + 1);

Shouldn't this be "rand = get_random_u32_below(i + 1)"?

> swap_free_obj(slab, i, rand);
> }
> --
> 2.38.0
>
>

\
 
 \ /
  Last update: 2022-12-13 16:03    [W:0.040 / U:2.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site