summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorDavid Keisar Schmidt <david.keisarschm@mail.huji.ac.il>2023-04-16 20:22:42 +0300
committerVlastimil Babka <vbabka@suse.cz>2023-05-22 15:22:08 +0200
commitf7e466e951a15bc7cec496f22f6276b854d3c310 (patch)
treeda60f9ef67602d6e5a4daa8d9725eecaabbb6723 /tools
parent44c026a73be8038f03dbdeef028b642880cf1511 (diff)
mm/slab: Replace invocation of weak PRNG
The Slab allocator randomization uses the prandom_u32 PRNG. That was added to prevent attackers to obtain information on the heap state, by randomizing the freelists state. However, this PRNG turned out to be weak, as noted in commit c51f8f88d705 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, we used get_random_u32_below, to achieve uniformity. In addition, we changed the freelist_init_state union to struct, since the rnd_state inside which is used to store the state of prandom_u32, is not needed anymore, since get_random_u32 maintains its own state. Signed-off-by: David Keisar Schmidt <david.keisarschm@mail.huji.ac.il> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions