mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 17:02:17 +00:00
Rather than incurring a division or requesting too many random bytes for the given range, use the prandom_u32_max() function, which only takes the minimum required bytes from the RNG and avoids divisions. This was done by hand, covering things that coccinelle could not do on its own. Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Yury Norov <[email protected]> Reviewed-by: Jan Kara <[email protected]> # for ext2, ext4, and sbitmap Acked-by: Jakub Kicinski <[email protected]> Signed-off-by: Jason A. Donenfeld <[email protected]>