The random number generator was not generating sufficient entropy by
authorMatthew Dillon <dillon@dragonflybsd.org>
Wed, 25 Jan 2006 19:56:31 +0000 (19:56 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Wed, 25 Jan 2006 19:56:31 +0000 (19:56 +0000)
commit8b3ec75a9165ba9cc6124fe3ef6c6776da209fb3
treeb044aa9bee317a0ef7120698b1f87758492facad
parentca60593c56cbf88ddea93e36ea5abdebef15161d
The random number generator was not generating sufficient entropy by
default, resulting in weak random numbers for a short period of time after
a machine is first booted.

* Change the entropy default for all interrupts except the clock interrupt
  from off to on.

* Greatly reduce the overhead of the interrupt entropy code so even high
  performance interrupts can call it.

* Instead of calculating the entropy at the time of the interrupt,
  introduce a new rate-limited kernel thread which the interrupt code can
  simply schedule.  The new thread will be responsible for adding the
  entropy.

  This thread will rate-limit based on the amount of entropy that has been
  built up.  The more entropy we have, the lower the thread's frequency of
  operation.  Currently the limit is set to 25 hz.

* Use the TSC in addition to the normal time calculation when introducing
  entropy.

Note that during tests it was found that a new ssh connection tends to
'eat' all available entropy.  This isn't actually true, it's really the
entropy calculation itself which is not quite correct, but I am duely noting
the issue here.

Reported-by: "Simon 'corecode' Schubert" <corecode@fs.ei.tum.de>
13 files changed:
sys/dev/disk/mpt/mpt_freebsd.h
sys/dev/raid/aac/aac_pci.c
sys/dev/raid/amr/amr_pci.c
sys/dev/raid/mlx/mlx.c
sys/dev/raid/twe/twe_freebsd.c
sys/i386/include/clock.h
sys/i386/isa/clock.c
sys/kern/kern_intr.c
sys/kern/kern_random.c
sys/platform/pc32/include/clock.h
sys/platform/pc32/isa/clock.c
sys/sys/bus.h
sys/sys/kernel.h