Hi Laurent,

2016-06-29 12:25 GMT+02:00 Laurent Bercot <ska-dietl...@skarnet.org>:
> On 29/06/2016 00:37, Etienne Champetier wrote:
>>
>> Or everyone can switch to getrandom() because that's the right way
>
>
>  The solution I am suggesting:
>  - works today and is extremely easy to implement.

same here

>  - does not require patching busybox.

the patch is done, just need some review

>  - will work on every Linux kernel on the planet, not only new ones with
> getrandom() support. And you *will* find old kernels out there.

Linux 3.17 was released on 05-10-2014, and if i use a recent kernel
why not use its features?
If you use an old kernel just don't use this applet, it's that simple.
If you use recent kernel and want to use getrandom() now you can.

>  - does not require porting/patching applications if they are currently
> using /dev/urandom.

My applet doesn't require changing current applications !?
If you want to wait until /dev/urandom is initialized, just do

getrandom 1 > /dev/null

see below why it's better than dd /dev/random


>
>  "The right way" had better be very right in order to be righter than that.
>
> (If your dd copies more than one byte when you give it count=1 bs=1, it's
> a bug. Can you send a strace?)

If we want to be safe, we have to use /dev/urandom only after its initialised
A simple tests adding this in an init script on a LEDE (OpenWrt) VM:

getrandom 1 > /dev/null
echo "### getrandom ###" > /dev/kmsg
dd if=/dev/random of=/dev/null count=1 bs=1
echo "### dd ###" > /dev/kmsg

gives:
[   14.321536] ### getrandom ###
[   42.603677] ### dd ###

And this can be worse on real hardware ...

>
>
> --
>  Laurent
>
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to