[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#897572: urandom hang in early boot



On 08/05/18 15:55, Ben Caradoc-Davies wrote:
If something calls getrandom without GRND_NONBLOCK while crng_init==1 (during early boot)
I now have conclusive evidence that this is the cause of the hang. If I add a printk:

diff --git a/drivers/char/random.c b/drivers/char/random.c
index cd888d4ee605..b7358cc32f42 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -2021,6 +2021,9 @@ SYSCALL_DEFINE3(getrandom, char __user *, buf, size_t, count,
        if (!crng_ready()) {
                if (flags & GRND_NONBLOCK)
                        return -EAGAIN;
+               printk(KERN_NOTICE "random: %s: getrandom without "
+                               "GRND_NONBLOCK while crng not ready\n",
+                               current->comm);
                ret = wait_for_random_bytes();
                if (unlikely(ret))
                        return ret;

I get these at the console just before the hang:

random: plymouthd: uninitialized urandom read (8 bytes read)
random: plymouthd: uninitialized urandom read (8 bytes read)
random: plymouthd: getrandom without GRND_NONBLOCK while crng not ready

Kind regards,

--
Ben Caradoc-Davies <ben@transient.nz>
Director
Transient Software Limited <https://transient.nz/>
New Zealand


Reply to: