Collecting entropy from device_attach() times.
Pawel Jakub Dawidek
pjd at FreeBSD.org
Thu Sep 20 10:20:52 UTC 2012
On Wed, Sep 19, 2012 at 11:10:51PM +0100, RW wrote:
> On Wed, 19 Sep 2012 22:53:32 +0200
> Pawel Jakub Dawidek wrote:
>
>
> > Here's how the distribution looks like for device_attach() times of my
> > sound card. The times were 26bit numbers, so this is after discarding
> > top ten bits, which leave us with 16 lower bits of pure entropy:)
> >
> > http://people.freebsd.org/~pjd/misc/harvest_device_attach.png
>
>
> You're basing a model for all devices on a single sound card, that
> doesn't seem safe to me. Isn't it possible that a device could take a
> long and well defined time? Some interrupts can carry a lot of entropy
> but they are still only accounted at 2 bits.
I agree, we should do such analysis for much more devices and different
kind of devices. A platform might be an important factor as well.
It is hard to collect decent number of probes when reboot is needed, so
what I'd recommend is to turn of SMP, boot into single module and
kldload/kldunload a driver in a loop, of course with kernel patched to
log those times.
> I don't see the point of trying to set a realistic number of bits
> unless there's a need for secure random numbers before initrandom. If
> there isn't then you might just as well set the estimation at zero
> bits, and avoid wasting cpu cycles on unnecessary spontaneous reseeds
> before the forced reseed.
It would be ideal if we could provide properly seeded PRNG even for
single-user mode, so eliminating initrandom altogether is also an
option, but also doesn't hurt to leave it as it is. I don't like
depending on initrandom as it doesn't help for single-user mode and it
might be easy to make some mistake by ordering rc.d/ scripts and placing
some script that needs properly seeded PRNG before initrandom.
Feeding enough entropy into yarrow before even root is mounted would be
perfect.
--
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-security/attachments/20120920/88ec2a6e/attachment.pgp
More information about the freebsd-security
mailing list