Re: [PATCH v2 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Jan Kara
On Thu 06-10-22 07:25:06, Jason A. Donenfeld wrote: > 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. > > Reviewed-by: Kees Cook > Revie

[PATCH v2 1/5] treewide: use prandom_u32_max() when possible

2022-10-06 Thread Jason A. Donenfeld
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. Reviewed-by: Kees Cook Reviewed-by: KP Singh Reviewed-by: Christoph Böhmwalder Signed-off-