[LTP] [PATCH v2] getrandom02: relax check for returned data

Jan Stancek jstancek@redhat.com
Wed Feb 8 15:18:01 CET 2017





----- Original Message -----
> From: "Cyril Hrubis" <chrubis@suse.cz>
> To: "Jan Stancek" <jstancek@redhat.com>
> Cc: ltp@lists.linux.it
> Sent: Wednesday, 8 February, 2017 3:12:51 PM
> Subject: Re: [PATCH v2] getrandom02: relax check for returned data
> 
> Hi!
> > "nb * 0.1" can easily fail for nb < 20, since all we need
> > are 2 identical bytes. Worst case (nb == 19) is almost
> > identical to "birthday problem", but with smaller pool.
> > Chance of hitting 2 identical bytes in pool of 19
> > is close to 50%.
> > 
> > Adjust formula to allow small repetitions in small pools.
> > Chance we fail now should be pretty unlikely, ~10^-16.
> > 
> > Signed-off-by: Jan Stancek <jstancek@redhat.com>
> 
> Acked.

Pushed.

Regards,
Jan

> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 


More information about the ltp mailing list