/dev/random was almost always returning 0 bytes. This was due to several
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 12 Apr 2006 18:20:54 +0000 (18:20 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 12 Apr 2006 18:20:54 +0000 (18:20 +0000)
commit1f30239450a6485ec98c3d5e3a7b4211a957678e
tree781efc6e6dda77e27024ae2f873c3166117ac338
parentb5160fd02e59974aa6cde050b97c0ef5718a4222
/dev/random was almost always returning 0 bytes.  This was due to several
factors, primarily the fact that the stack smash handler reads 32 bytes from
/dev/urandom every time a program is exec'd, and because /dev/random and
/dev/urandom share the same pool.

involved:  (1) The stack smash handler reads 32 bytes from /dev/urandom every
time a program is exec'd.  This exhausts the pool almost immediately.
(2) /dev/random and /dev/urandom share the same pool, and /dev/urandom is
called so often that there is never any entropy available for /dev/random.

Give /dev/random and /dev/urandom separate entropy pools and make the entropy
loss calculation less conservative.

Reported-by: David Rhodus
sys/kern/kern_random.c