[LEDE-DEV] [PATCH v5] base-files: seed /dev/urandom

Etienne Champetier champetier.etienne at gmail.com
Mon Jul 18 22:40:01 PDT 2016


2016-07-19 7:09 GMT+02:00 Jo-Philipp Wich <jo at mein.io>:
> Hi Daniel,
>
> interesting failure mode ;(
>
> To me it seems the easiest fix is changing the getrandom syscall wrapper
> utility to use the GRND_NONBLOCK flag in order to be interruptible by
> signals.
>
> Thoughts?

According to the man page it's already interruptible if /dev/urandom
init is not done
http://man7.org/linux/man-pages/man2/getrandom.2.html

The behavior when a call to getrandom() that is blocked while reading
from /dev/urandom is interrupted by a signal handler depends on the
initialization state of the entropy buffer and on the request size,
buflen.  If the entropy is not yet initialized, then the call will
fail with the EINTR error.

and getrandom handle syscall errors
https://git.lede-project.org/?p=project/ubox.git;a=blob;f=getrandom.c;h=96712028589b100f3fab845f92d7fd554428efe4;hb=HEAD

quick fix before I understand the problem is to add
getrandom 1 > /dev/null



>
> ~ Jo
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev



More information about the Lede-dev mailing list