Re: [PATCH v2 1/3] Replace invocation of weak PRNG in mm/slab.c

From: Matthew Wilcox
Date: Tue Dec 13 2022 - 10:02:55 EST


On Tue, Dec 13, 2022 at 12:34:57PM +0200, david.keisarschm@xxxxxxxxxxxxxxx wrote:
> From: David <david.keisarschm@xxxxxxxxxxxxxxx>

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
>
>