Skip to content
Commit ffe4dfe0 authored by David Keisar Schmidt's avatar David Keisar Schmidt Committed by Vlastimil Babka
Browse files

mm/slab_common: Replace invocation of weak PRNG



The Slab allocator randomization inside slab_common.c
uses the prandom_u32 PRNG. That was added to prevent attackers to obtain
information on the heap state.

However, this PRNG turned out to be weak, as noted in commit c51f8f88
To fix it, we have changed the invocation of prandom_u32_state to get_random_u32
to ensure the PRNG is strong.

Since a modulo operation is applied right after that,
in the Fisher-Yates shuffle, we used get_random_u32_below, to achieve uniformity.

Signed-off-by: default avatarDavid Keisar Schmidt <david.keisarschm@mail.huji.ac.il>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent f7e466e9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment