On Wed, Oct 01, 2003 at 03:31:44PM +0300, Oded Arbel wrote:
> 
> Hi list.
>  
> I'm having a problem with a server, where apparently I don't have any entropy 
> left in /dev/random :
> # sysctl -A | grep random
> kernel.random.entropy_avail = 0
> 
> and of course - every call to /dev/random blocks. the server in question is a 
> headless box, so of course no entropy is generated by HID devices such as 
> mouse and keyboard, but IIRC dev/random should also be filled by disc access 
> (of which there is a lot) and maybe network (I remember a discussion on 
> turning off entropy feeding from the NICs, but I don't remember if it was 
> actually carried out).

Some NICs generate entropy, some don't. Which depends on your kernel
version and possibly runtime configuration. 

> The kernel is 2.4.21 with grsecurity patches, and I was wandering if anyone 
> has any idea what I can do now - can I somehow seed dev/random by
hand ? 

Why not use /dev/urandom? that one never blocks. 

> All the file systems are reiserFS, which raises the following
> question - is it  possible that reiserFS block I/O does not generate
> entropy ? 

It's possile, yes. Looking at the code (2.4.23-pre5, but I doubt there
were major changes in this area in the vanilla kernels), the relevant
function is add_blkdev_randomness, which works at the block layer, not
the file system layer, so it doesn't have much to do with
reiserfs. Quoting from drivers/char/random.c for ways for you to
generate entropy: 

 * Exported interfaces ---- input
 * ==============================
 * 
 * The current exported interfaces for gathering environmental noise
 * from the devices are:
 * 
 *      void add_keyboard_randomness(unsigned char scancode);
 *      void add_mouse_randomness(__u32 mouse_data);
 *      void add_interrupt_randomness(int irq);
 *      void add_blkdev_randomness(int irq);
 * 
 * add_keyboard_randomness() uses the inter-keypress timing, as well as the
 * scancode as random inputs into the "entropy pool".
 * 
 * add_mouse_randomness() uses the mouse interrupt timing, as well as
 * the reported position of the mouse from the hardware.
 *
 * add_interrupt_randomness() uses the inter-interrupt timing as random
 * inputs to the entropy pool.  Note that not all interrupts are good
 * sources of randomness!  For example, the timer interrupts is not a
 * good choice, because the periodicity of the interrupts is too
 * regular, and hence predictable to an attacker.  Disk interrupts are
 * a better measure, since the timing of the disk interrupts are more
 * unpredictable.
 * 
 * add_blkdev_randomness() times the finishing time of block requests.
 * 
-- 
Muli Ben-Yehuda
http://www.mulix.org

Attachment: signature.asc
Description: Digital signature

Reply via email to