On 04/23/18 12:40, Miroslav Lichvar wrote:
On Mon, Apr 23, 2018 at 12:05:55PM +0200, Holger Hoffstätte wrote:
So it's probably indeed blocking in too-early getrandom() (thanks for
pointing that out!)and falling back to urandom with GRND_NONBLOCK could
work. Let me know if I can try any patches.

You can try the following patch. It should prevent getrandom() from
blocking and allow fall back to /dev/urandom.

--- a/util.c
+++ b/util.c
@@ -1224,7 +1224,7 @@ get_random_bytes_getrandom(char *buf, unsigned int len)
        if (disabled)
          break;
- if (getrandom(rand_buf, sizeof (rand_buf), 0) != sizeof (rand_buf)) {
+      if (getrandom(rand_buf, sizeof (rand_buf), GRND_NONBLOCK) != sizeof 
(rand_buf)) {
          disabled = 1;
          break;
        }


Works as expected. \o/

Tested-by: Holger Hoffstätte <hol...@applied-asynchrony.com>

Thanks!
Holger

--
To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org with "unsubscribe" in the subject. For help email chrony-users-requ...@chrony.tuxfamily.org with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.

Reply via email to