I've now committed most of your diff, thanks once again.
o I asked for further review on the kernel parts
o I'm going to skip hack for now
Here's a patch for libc, based on the previous discussion.
I think this is easier to read and understand. No binary change on
amd64.
ok?
Index:
Matthew Martin writes:
> On Mon, Dec 07, 2015 at 09:33:47AM +0100, Theo Buehler wrote:
>> I think some of these are ok, but I'm unsure about some of the others.
>> Here are some of my concerns:
>>
>> - since arc4random_uniform can potentially loop indefinitely, it
>> might
On Mon, Dec 07, 2015 at 12:49:17AM -0600, Matthew Martin wrote:
>
> Theo's diff inspired me to look for other cases of modulo bias. The
> following diff converts most modulus operations on a random number to
> use arc4random_uniform or & as appropriate. I excluded
>
>
On Mon, Dec 07, 2015 at 09:33:47AM +0100, Theo Buehler wrote:
> I think some of these are ok, but I'm unsure about some of the others.
> Here are some of my concerns:
>
> - since arc4random_uniform can potentially loop indefinitely, it
> might interfere with predictable timing of some routines.
> I'll look into hack tonight when I have more time.
Honestly, I would prefer to leave hack as it is right now since it will
take some work to repair it anyway. I would not want to add another
layer of (potential) complications.
> > > Index: lib/libc/stdlib/rand.c
> > >
Theo's diff inspired me to look for other cases of modulo bias. The
following diff converts most modulus operations on a random number to
use arc4random_uniform or & as appropriate. I excluded
lib/libsqlite3/src/resolve.c
regress/lib/libevent/test-time.c
usr.sbin/nsd/rrl.c
usr.sbin/nsd/util.c