Re: /dev/random blocks forever on 2.2.12 and 2.2.16

From: Andi Kleen (ak@suse.de)
Date: Tue Aug 08 2000 - 09:04:13 EST


On Tue, Aug 08, 2000 at 03:56:12PM +0200, Oscar Roozen wrote:
> On Tue, Aug 08, 2000 at 02:59:32PM +0200, Andi Kleen wrote:
> > > The only call to add_interrupt_randomness I can find is in */kernel/pci.c
> > > from handle_IRQ_event and I don't understand why this one never gets called
> > > on this machine. Also the only call to add_blkdev_randomness is in ide.c.
> > > Why is there no call from any of the scsi/*.c drivers?
> >
> > I guess you just need to change the request_irq call in the SMART2 driver
> > to specify the SA_SAMPLE_RANDOM flag. I'm not sure if it is a good idea
> > though, because e.g. for bulk data transfers the intervals between RAID
> > interrupts are probably not very random and may add bogus numbers to your
> > entropy pool.
>
> You've got a point here. But then, there is also a lot of network traffic
> going on around this machine. Maybe I'll have to look into the eepro100
> sources for that.
>
> Is it possible that there are drivers that should set this flag, but don't?

I'm not sure. One possible attack would be to try to change your entropy
pool by sending packets in the right frequency,
also e.g. regular broadcasts may not have enough jitter. One possible fix
for that would be to use a secure random generator with a secret that selects
which packets to get information from etc, but there may be again attacks
with that.

When you're really paranoid use a hardware rnd.

>
> > The randomness generation in scsi/* is also not used, because SMART2 bypasses
> > the SCSI layer completely.
>
> Is there randomness generation from scsi/* then? It's a 2.2.x series here.

Make your own conclusions (end_request is normally used by drivers to tell
the upper layers that it finished an IO)

#if ! SCSI_BLK_MAJOR(MAJOR_NR) && (MAJOR_NR != COMPAQ_SMART2_MAJOR)

static void end_request(int uptodate) {
        struct request *req = CURRENT;

        if (end_that_request_first(req, uptodate, DEVICE_NAME))
                return;

#ifndef DEVICE_NO_RANDOM
        add_blkdev_randomness(MAJOR(req->rq_dev));
#endif

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:15 EST