A bit more info in case anyone is interested...

I enable tracing and found something interesting.  It seems that the number of 
entropy bits go negative at some point:

<...>-28916 [002] 535863.435655: extract_entropy: input pool: nbytes 8 
entropy_count 3646 caller xfer_secondary_pool+0xaa/0x10c
<...>-28916 [002] 535863.435662: mix_pool_bytes_nolock: input pool: bytes 20 
caller extract_buf+0xc0/0x154
<...>-28916 [002] 535863.435664: mix_pool_bytes: blocking pool: bytes 8 caller 
xfer_secondary_pool+0xc6/0x10c
<...>-28916 [002] 535863.435665: credit_entropy_bits: blocking pool: bits 64 
entropy_count 64 entropy_total 1024 caller xfer_secondary_pool+0xd4/0x10c
<...>-28916 [002] 535863.435672: mix_pool_bytes_nolock: blocking pool: bytes 20 
caller extract_buf+0xc0/0x154
<...>-28919 [003] 535863.437207: extract_entropy_user: blocking pool: nbytes 4 
entropy_count 32 caller random_read+0x60/0x150
<...>-28919 [003] 535863.437212: mix_pool_bytes_nolock: blocking pool: bytes 20 
caller extract_buf+0xc0/0x154
<...>-28924 [001] 535863.439902: extract_entropy: nonblocking pool: nbytes 16 
entropy_count -32 caller get_random_bytes+0x38/0x48
<...>-28926 [003] 535863.440827: extract_entropy: nonblocking pool: nbytes 16 
entropy_count -32 caller get_random_bytes+0x38/0x48

And that's what's causing no data to be returned.  Haven't figured out yet why 
it goes negative.

But, I was able to semi-correct the issue by running the following:

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <linux/random.h>

int
main(int argc, char *argv[])
{
    int fd = open("/dev/urandom", O_RDWR);
    if (fd)
    {
        ioctl(fd, RNDCLEARPOOL);
        perror("error");
        close(fd);
    }
}

I now get data back:

pzsfs101:~ # dd if=/dev/urandom of=/dev/null count=10
10+0 records in
10+0 records out
5120 bytes (5.1 kB) copied, 0.00164344 s, 3.1 MB/s

And the dynamic UUID looks better now:

pzsfs101:~ # grep '' /proc/sys/kernel/random/*
/proc/sys/kernel/random/boot_id:00000000-0000-4000-8000-000000000000
/proc/sys/kernel/random/entropy_avail:2179
/proc/sys/kernel/random/poolsize:4096
/proc/sys/kernel/random/read_wakeup_threshold:64
/proc/sys/kernel/random/uuid:af2ccaee-221b-4128-ab5a-389eb7eaa3fd
/proc/sys/kernel/random/write_wakeup_threshold:1024

And it updates as it should each time the it is read.

Anyway, still no idea exactly what happened.

Leland

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/

Reply via email to