public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Sources of entropy - /dev/random problem for network servers
@ 2001-04-08 22:46 Alex Bligh - linux-kernel
  2001-04-08 23:33 ` Jeff Garzik
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Alex Bligh - linux-kernel @ 2001-04-08 22:46 UTC (permalink / raw)
  To: linux-kernel; +Cc: Alex Bligh - linux-kernel

In debugging why my (unloaded) IMAP server takes many seconds
to open folders, I discovered what looks like a problem
in 2.4's feeding of entropy into /dev/random. When there
is insufficient entropy in the random number generator,
reading from /dev/random blocks for several seconds. /dev/random
is used (correctly) for crytographic key verification.

Entropy comes from 4 sources it seems: Keyboard, Mouse, Disk I/O
and IRQs.

The machine in question is locked in a data center (can't be
the only one) and thus sees none of the former two. IDE Entropy
comes from executed IDE commands. The disk is physically largely
inactive due to caching. But there's plenty of network traffic
which should generate IRQs.

However, only 3 drivers in drivers/net actually set
SA_SAMPLE_RANDOM when calling request_irq(). I believe
all of them should. And indeed this fixed the problem for
me using an eepro100().

The following patch fixes eepro100.c - others can be
patched similarly.

--
Alex Bligh

/usr/src/linux# diff -C3 drivers/net/eepro100.c{.keep,}
*** drivers/net/eepro100.c.keep Tue Feb 13 21:15:05 2001
--- drivers/net/eepro100.c      Sun Apr  8 22:17:00 2001
***************
*** 923,929 ****
        sp->in_interrupt = 0;

        /* .. we can safely take handler calls during init. */
!       retval = request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ, 
dev->name, dev);
        if (retval) {
                MOD_DEC_USE_COUNT;
                return retval;
--- 923,929 ----
        sp->in_interrupt = 0;

        /* .. we can safely take handler calls during init. */
!       retval = request_irq(dev->irq, &speedo_interrupt, SA_SHIRQ | 
SA_SAMPLE_RANDOM, dev->name, dev);
        if (retval) {
                MOD_DEC_USE_COUNT;
                return retval;

[ENDS]

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Sources of entropy - /dev/random problem for network servers
@ 2001-04-09 11:04 Heusden, Folkert van
  2001-04-10  5:37 ` idalton
  0 siblings, 1 reply; 8+ messages in thread
From: Heusden, Folkert van @ 2001-04-09 11:04 UTC (permalink / raw)
  To: Alex Bligh - linux-kernel; +Cc: linux-kernel

>> However, only 3 drivers in drivers/net actually set
>> SA_SAMPLE_RANDOM when calling request_irq(). I believe
>> all of them should.
> No, because an attacker can potentially control input and make it
> non-random.
AB> 2. Given that otherwise in at least my application (and machine
AB> without keyboard and mouse can't be too uncommon) there is *no*
AB> entropy otherwise, which is rather easier for a hacker. At least

Put a soundcard in your system and install audio-entropyd.
Works pretty nice.

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Sources of entropy - /dev/random problem for network servers
@ 2001-04-10 13:56 Heusden, Folkert van
  0 siblings, 0 replies; 8+ messages in thread
From: Heusden, Folkert van @ 2001-04-10 13:56 UTC (permalink / raw)
  To: idalton; +Cc: Alex Bligh - linux-kernel, linux-kernel

> AB> 2. Given that otherwise in at least my application (and machine
> AB> without keyboard and mouse can't be too uncommon) there is *no*
> AB> entropy otherwise, which is rather easier for a hacker. At least
> Put a soundcard in your system and install audio-entropyd.
> Works pretty nice.
I> Do you know where to find it? Freshmeat has a listing, but it's
I> pointing to mindrot.org and is 404 not found.

I still had the tgz-file. You can download the tarball from:
http://www.vanheusden.com/mirrors/


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2001-04-10 13:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-04-08 22:46 Sources of entropy - /dev/random problem for network servers Alex Bligh - linux-kernel
2001-04-08 23:33 ` Jeff Garzik
2001-04-09  7:59   ` Alex Bligh - linux-kernel
2001-04-09  0:15 ` Andi Kleen
2001-04-09  6:17 ` David Wagner
  -- strict thread matches above, loose matches on Subject: below --
2001-04-09 11:04 Heusden, Folkert van
2001-04-10  5:37 ` idalton
2001-04-10 13:56 Heusden, Folkert van

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox