On 20/07/14 14:30, Justin Cormack wrote:
>> What is the benefit of using arc4random?  Why not just use urandom on all
>> platforms all the time?
>
> arc4random is more performant, has no failure cases, and on eg freebsd
> /dev/urandom is just a symlink to /dev/random so thats probably not
> what you want.

It has at least one failure case, except you can't control it:
http://nxr.netbsd.org/xref/src/lib/libc/gen/arc4random.c#179

I'm still not convinced, but you seem to want it, so go ahead.

>> Again, I'd use the part from your patch where /dev/urandom is used, and
>> strip out the rest.  _If_ some actual problems appear from the use of
>> /dev/urandom, we can try to apply band-aid and bubblegum.  But, really,
>> should try to fix the issue properly by looking at the NetBSD kernel side of
>> the code, and thinking how to best make it cope with short-lived,
>> multi-instance virtual environments.  Only if the result of that
>> investigation is that it's not possible, would I be happy with configuration
>> toggles.
>
> Well here is a simpler version without config, well the config is
> "change the code" and its fairly easy to change if you want to. if you
> wanted you could compile non BSD with -lbsd to get arc4random support
> too.

I guess that's ok for config, if someone changes the code they probably 
understand that we're not obliged to support whatever modifications they 
made.

Can arc4random_buf() be considered to be universally available with 
arc4random?  NetBSD grew it only in netbsd-6.

Do the init in rumpuser_init().  If you want a shared implementation, 
add an init routine which is included in pthread/fiber implementations 
instead of sprinkling init stuff along runtime paths.  That way you can 
return an init error e.g. in case /dev/urandom isn't available in a 
chroot instead of a runtime error.

ET(rv): should translate errno instead instead of rv.

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
rumpkernel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rumpkernel-users

Reply via email to