Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/csrand.c: Fix the lower part of the domain of csrand_uniform()
I accidentally broke this code during an un-optimization. We need to start from a random value of the width of the limit, that is, 32 bits. Thanks to Jason for pointing to his similar code in the kernel, which made me see my mistake. Fixes: 2a61122 ("Unoptimize the higher part of the domain of csrand_uniform()") Closes: <#1015> Reported-by: Michael Brunnbauer <https://github.com/michaelbrunnbauer> Link: <https://git.zx2c4.com/linux-rng/tree/drivers/char/random.c#n535> Cc: "Jason A. Donenfeld" <[email protected]> Link: <#638> Link: <#634> Link: <#624> Tested-by: Michael Brunnbauer <https://github.com/michaelbrunnbauer> Reviewed-by: Michael Brunnbauer <https://github.com/michaelbrunnbauer> Signed-off-by: Alejandro Colomar <[email protected]> Cherry-picked-from: 4119a2dce564 ("lib/csrand.c: Fix the lower part of the domain of csrand_uniform()") Cc: "Serge E. Hallyn" <[email protected]> Link: <#1025> Signed-off-by: Alejandro Colomar <[email protected]>
- Loading branch information